[BUGFIX] JavaScript generation in RTE element browser 38/28338/2
authorAlexander Stehlik <alexander.stehlik@gmail.com>
Thu, 13 Mar 2014 10:23:21 +0000 (11:23 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Fri, 14 Mar 2014 16:45:36 +0000 (17:45 +0100)
The JavaScript in the RTE element browser is now initialized at the
end of the initialization process to make sure that all required
class variables (like $this->act) are initialized.

Resolves: #56860
Releases: 6.2
Change-Id: I39d3223921c5b17cffb31d98d62f02fa46663d27
Reviewed-on: https://review.typo3.org/28338
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/rtehtmlarea/Classes/BrowseLinks.php

index 8b658ad..8d9868e 100644 (file)
@@ -71,6 +71,11 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                }
                // Setting initial values for link attributes
                $this->initLinkAttributes();
+
+               // Adding RTE JS code
+               // also unset the default jumpToUrl() function before
+               unset($this->doc->JScodeArray['jumpToUrl']);
+               $this->doc->JScodeArray['rtehtmlarea'] = $this->getJSCode();
        }
 
        /**
@@ -120,10 +125,6 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                $this->doc->getPageRenderer()->addCssFile($this->doc->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3skin') . 'rtehtmlarea/htmlarea.css');
                // Add attributes to body tag. Note: getBodyTagAdditions will invoke the hooks
                $this->doc->bodyTagAdditions = $this->getBodyTagAdditions();
-               // Adding RTE JS code
-               // also unset the default jumpToUrl() function before
-               unset($this->doc->JScodeArray['jumpToUrl']);
-               $this->doc->JScodeArray['rtehtmlarea'] = $this->getJSCode();
        }
 
        /**