Bug #21429
closedhtmlArea RTE: Text not editable after pasting with server-based cleaning
0%
Description
If RTE.default.disableRightClick = 1 is setting in TSconfig and you use the right click (past and copy) in RTE then after you can't edit the text. Only after save the record you can edit the text in RTE.
Browser: only in Firefox
RTE: 2.0.3
TYPO3: 4.4.2
(issue imported from #M15430)
Files
Updated by Stanislas Rolland about 14 years ago
I am unable to reproduce this issue. If I disable the RTE context menu, then I get the Firefox context menu on right click, which contains actions from the Firefox menu. All seem to work correctly.
Is there an error on the JavaScript console when the problem occurs?
Updated by Administrator Admin about 14 years ago
I noticed a similiar behavior in the RTE (2.0.3)
When pasting text with ctrl-v in Firefox (3.5.x) the text is pasted fine, but it can't be edited until you save it once.
I can reproduce this everytime on TYPO3 Version 4.4.2.
Seems to be related to the mentioned Bug. (except for not setting disableRightClick)
To Stanislas:
there is indeed a javascript error:
"startSpan is null" in "htmlarea_cumulative" js
Updated by Felix Nagel about 14 years ago
We struggled with the same problem. I re-wrote our config, which solved the problem. Im not able to define what exactly was the problem.
Take a look at out config here:
http://pastebin.com/AKquuaVR
We do not disable the right click by using disableRightClick = 1 but we do not get a context menu, any idea why?
Updated by Administrator Admin about 14 years ago
Your configuration solves the problem for me as well...
I hope i can figure out what part of the config is the key...
When using your Configuration 1:1 the Context PopUp does appear on my testsite.
Updated by Felix Nagel about 14 years ago
Mhh, it should be as disableRightClick = 0 is set, but context menu does not appear in several of our installations. I really dont understand, but configuring TYPO3 rte always painful -- but its getting better thanks to Stanislas.
Im sorry, just recognized a disableRightClick = 1 TS config in an additional TSconfig (in rootpage). Just disable it in my posted code!
Fixed TS config code:
http://pastebin.com/X0wbUiWt
Updated by Stanislas Rolland about 14 years ago
So, which TS Config allows to reproduce the problem?
Updated by Felix Nagel about 14 years ago
This config http://pastebin.com/7MnvPcqv does not work on a TYPO3 4.4.2 with delivered htmlarea.
It worked well before, so I assume its about the new ExtJs based version of htmlarea.
Updated by Administrator Admin about 14 years ago
I might be able to help a little here...
We narrowed down the error to one single line, checking your submitted configurations, it supported our thoughts..
when we set:
RTE.default.proc.entryHTMLparser_db.tags.span.allowedAttribs = class,style,align
the error with not being able to edit inserted text does happen throwing a javascript error: "startSpan is null"
when commenting out that statement the configuration works...
that line is in your posted "non-working" configuration as well... so it really seems to be the cause...
... and it definately worked with earlier versions...
hope this is of any help to find "the root of evil"....
Updated by Stanislas Rolland about 14 years ago
@Markus: Yes! Thanks for tracking this down! I am now able to reproduce this issue.
Updated by Stanislas Rolland about 14 years ago
The root of evil: The problem arises when id attribute is removed from span tags by server-based cleaning on paste.
In non-IE browsers, special span tags are added by the RTE in order to be able to restore the selection and cursor position when the cleaned text is returned from the server. If the id attribute is removed, or if the span tag is cleaned-away, the special span tag cannot be located and an error is raised.
The attached patch will prevent the error from being raised. If the span tag or its id attribute was removed, the cursor will be put at the beginning of the text.
A note will be added to the manual regarding the configuration of enableWordClean.
Updated by Administrator Admin about 14 years ago
@Stanislas:
great, thanks!
so as an alternative to patching the rte you could add id to
RTE.default.proc.entryHTMLparser_db.tags.span.allowedAttribs = class,style,align
something like:
RTE.default.proc.entryHTMLparser_db.tags.span.allowedAttribs = id,class,style,align
will work.. i just tried...
that makes it a really easy fix...
Updated by Stanislas Rolland about 14 years ago
@Markus: I thought about that, but there are many properties of HTMLparser that may cause the span tag or its id attribute to be removed, among them: allowTags, noAttrib, removeTags, span.allowedAttribs, span.fixAttrib.id.unset.
Not so easy...
Updated by Stanislas Rolland about 14 years ago
Second version of the patch will do both: protect the RTE in case the span tag with id was somehow removed, and attempt to modify incoming HTMLparser cleaning configuration.
Updated by Stanislas Rolland about 14 years ago
Committed to SVN TYPO3core trunk (revision 8886), branch TYPO3_4-4 (revision 8887) and branch TYPO3_4-3 (revision 8888).
Updated by Stanislas Rolland about 14 years ago
Attached follow-up patch removes lines that should not have been inserted by the initial patch.
Committed to SVN TYPO3core trunk (revision 8889), branch TYPO3_4-4 (revision 8890) and branch TYPO3_4-3 (revision 8891).