[TYPO3-core] RFC: Bug #5994: IRRE - RTEhtmlarea is not show in child records if parent has no RTE

Oliver Hader oh at inpublica.de
Sun Sep 30 14:35:18 CEST 2007


This is a SVN patch request.

Problem:
Imagine a the following scenario:
* parent table with no RTE field; embedding child records using IRRE
* child table with one or more RTE fields
When creating a new parent record and then in the same step a new child
record, the required JavaScripts for RTEhtmlarea are not present and
thus, RTE cannot be used. If the paren with at least one child record
was saved and the form reloaded, the JavaScript libs for RTE are loaded
and everything works as expected.

Solution:
The reason is, that on rendering the parent table in TCEforms, it's
unknown at that time, that child records might have RTE fields and thus
those JavaScript libraries for RTE were required. Furthermore there's no
"direct" way of including JavaScripts with '<script src="..." />' on
AJAX calls.
The solution is, to parse the HTML code that is normally put into the
'<head>' tag of an HTML page during an AJAX call for '<script>' tags and
put a hint to the JSON data that is delivered back to the browser. These
tags are there processed with JavaScript and put to the '<head>' tag of
the current HTML page.
Since I do not know about a possibility in JavaScript to set global
variables from inside a function, I removed the 'var' types of the
JavaScript output in class.tx_rtehtmlarea_base.php.

Comments:
The patches for the 4.1 branch and Trunk are attached. In the
bugtracker, there's an extension which allows one to test this issue.
Since this is related to IRRE only, I'm going to commit in one week if
nobody objects.

Bugtracker references:
http://bugs.typo3.org/view.php?id=5994

Branches: TYPO3_4-1 & Trunk


olly
-- 
Oliver Hader
http://inpublica.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005994_4-1.patch
Type: text/x-diff
Size: 12015 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070930/e79b4047/attachment.patch 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005994_trunk.patch
Type: text/x-diff
Size: 12015 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20070930/e79b4047/attachment-0001.patch 


More information about the TYPO3-team-core mailing list