Actions
Bug #78048
closedFirefox: JS Error when inserting image in empty RTE
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
-
Start date:
2016-09-23
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
5.5
Tags:
rte, image
Complexity:
Is Regression:
No
Sprint Focus:
Description
When inserting an image in an empty RTE editor field, a JS error is triggered in firefox.
The image does not show up in code view and is gone after saving.
Steps to reproduce
- Create a new Textmedia Element in Firefox
- Do NOT modify the input field in any way
- Set the cursor into the RTE textarea field (do NOT enter any text)
- Click on the 'insert image'-Button and select an image
- Image is inserted. Check the code view -> Image is not there
- console says: TypeError: parentElement is null
- Save the document -> Image is gone
If the textarea contains anything, even a space or an empty line, the error does not occur
It's important not to modify the input field in any way besides inserting the image. Even if you enter a space and remove it again, the error will not occur.
Error occurs in
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/BlockElements.js:1041
[...] var parentElement = statusBarSelection ? statusBarSelection : this.editor.getSelection().getParentElement(); if (!/^body$/i.test(parentElement.nodeName)) { while (parentElement && parentElement != null && !Dom.isBlockElement(parentElement) || /^li$/i.test(parentElement.nodeName)) { parentElement = parentElement.parentNode; } [...]
Actions