Bug #44629
closedJS Error in IE and inline tceforms
0%
Description
If you use tceforms inline elements which uses any kind of javascript code (which will be retrieved via AJAX and an json-response (> "headerData")) , the commings JS-Code could not be evaluated by an internter explorer (tested in native IE8 and native IE9)!
The evaluation of the js code fails in "jsfunc.inline.js" in line 196, because the comming code starts an ends with HTML-commtnets (""). When the comments are removed, the inline elements works very well.
For examplte the comming RTE inside an inline element won't be initialized!
The "" wrap arround the JS-code is generated by t3lib_pagerenderer (see inlineJavascriptWrap). Why we need the comments today? The easiest way is to remove the comments inside the t3lib_pagerenderer-class. A other solution is to replace the comments in t3lib_tceforms_inline::getHeadTags inside the foreach-loop:
[code]foreach ($tags as $tagData) {
- $tagName = $parseObj->getFirstTagName($tagData);
$innerHTML = $parseObj->removeFirstAndLastTag($tagData);
if ($tagName === 'SCRIPT')
{
$innerHTML = trim($innerHTML);
$innerHTML = preg_replace('/^\<\!\-\-/', '', $innerHTML);
$innerHTML = preg_replace('/\/\/\s*\-\-\>$/', '', $innerHTML);
}*
$tagAttributes = $parseObj->get_tag_attributes($parseObj->getFirstTag($tagData), TRUE);
$headTags[] = array(
'name' => $tagName,
'attributes' => $tagAttributes[0],
'innerHTML' => $innerHTML,
);
}
[/code]
This issue was tested in TYPO3 4.7