[BUGFIX] Load RequireJs in PageRenderer:: addRequireJsConfiguration() 78/47478/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 1 Apr 2016 08:46:30 +0000 (10:46 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 8 Apr 2016 12:30:11 +0000 (14:30 +0200)
``PageRenderer:: addRequireJsConfiguration`` does now load RequireJS
in the backend, as this method is called before ``loadRequireJs()``
otherwise, colliding with how ``loadRequireJs()`` handles RequireJS.

This is not done in frontend, as the output could get broken.

Resolves: #75353
Releases: master, 7.6
Change-Id: I7a1140036dcbf9ab869b361c40fedc3813a887d3
Reviewed-on: https://review.typo3.org/47478
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Markus Sommer <markussom@posteo.de>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Page/PageRenderer.php

index 7a6b7c7..ada7c1c 100644 (file)
@@ -1597,6 +1597,10 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
      */
     public function addRequireJsConfiguration(array $configuration)
     {
+        if (TYPO3_MODE === 'BE') {
+            // Load RequireJS in backend context at first. Doing this in FE could break the output
+            $this->loadRequireJs();
+        }
         \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($this->requireJsConfig, $configuration);
     }