[BUGFIX] Parser file not always an array in json_encode 75/41875/3
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 23 Jul 2015 11:45:18 +0000 (13:45 +0200)
committerSusanne Moog <typo3@susannemoog.de>
Thu, 23 Jul 2015 17:50:29 +0000 (19:50 +0200)
The parser file is not always an array. Instead it is a string.
In the end it is returned as json_encode.
This breaks the loading of the parser file.

Resolves: #68483
Releases: master
Change-Id: Ica253fd08dfacabfad2b80ad853c6890ca571c75
Reviewed-on: http://review.typo3.org/41875
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Susanne Moog <typo3@susannemoog.de>
Tested-by: Susanne Moog <typo3@susannemoog.de>
typo3/sysext/t3editor/Classes/Hook/FileEditHook.php
typo3/sysext/t3editor/Classes/T3editor.php

index d475baf..2b8520b 100644 (file)
@@ -36,7 +36,7 @@ class FileEditHook {
         * @return \TYPO3\CMS\T3editor\T3editor
         */
        protected function getT3editor() {
-               if ($this->t3editor == NULL) {
+               if ($this->t3editor === NULL) {
                        $this->t3editor = GeneralUtility::makeInstance(\TYPO3\CMS\T3editor\T3editor::class)->setAjaxSaveType($this->ajaxSaveType);
                }
                return $this->t3editor;
@@ -68,7 +68,7 @@ class FileEditHook {
        public function preStartPageHook($parameters, $documentTemplate) {
                if (GeneralUtility::_GET('M') === 'file_edit') {
                        $t3editor = $this->getT3editor();
-                       $documentTemplate->JScode .= $t3editor->getJavascriptCode($documentTemplate);
+                       $t3editor->getJavascriptCode($documentTemplate);
                        $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/T3editor/FileEdit');
                }
        }
index f04324d..736aba4 100644 (file)
@@ -232,13 +232,13 @@ class T3editor implements \TYPO3\CMS\Core\SingletonInterface {
                                $parserfile = array('tokenizetyposcript.js', 'parsejavascript.js');
                                break;
                        case self::MODE_CSS:
-                               $parserfile = 'parsecss.js';
+                               $parserfile = array('parsecss.js');
                                break;
                        case self::MODE_XML:
-                               $parserfile = 'parsexml.js';
+                               $parserfile = array('parsexml.js');
                                break;
                        case self::MODE_SPARQL:
-                               $parserfile = 'parsesparql.js';
+                               $parserfile = array('parsesparql.js');
                                break;
                        case self::MODE_HTML:
                                $parserfile = array('tokenizejavascript.js', 'parsejavascript.js', 'parsecss.js', 'parsexml.js', 'parsehtmlmixed.js');
@@ -341,13 +341,6 @@ class T3editor implements \TYPO3\CMS\Core\SingletonInterface {
        /**
         * Save the content from t3editor retrieved via Ajax
         *
-        * new Ajax.Request('/dev/t3e/dummy/typo3/ajax.php', {
-        * parameters: {
-        * ajaxID: 'T3editor::saveCode',
-        * t3editor_savetype: 'TypoScriptTemplateInformationModuleFunctionController'
-        * }
-        * });
-        *
         * @param array $params Parameters (not used yet)
         * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj AjaxRequestHandler to handle response
         */