[BUGFIX] FormEngine: Type input eval userfunc not called in JS 91/39091/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 30 Apr 2015 13:13:29 +0000 (15:13 +0200)
committerAndreas Fernandez <andreas.fernandez@aspedia.de>
Thu, 30 Apr 2015 13:55:27 +0000 (15:55 +0200)
It is possible to add custom JS as eval function for type input. This
is no longer called after FormEngine refactoring due to an additional
quoteJSvalue() that is missing in the reference.

Resolves: #66689
Releases: master
Change-Id: I31c7b1f01e37e21aa4bf6d27f324cb522be74fe5
Reviewed-on: http://review.typo3.org/39091
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
typo3/sysext/backend/Classes/Form/Element/InputElement.php

index a626a66..c298a6e 100644 (file)
@@ -210,7 +210,7 @@ class InputElement extends AbstractFormElement {
                foreach ($evalList as $evalData) {
                        $evalObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$evalData] . ':&' . $evalData);
                        if (is_object($evalObj) && method_exists($evalObj, 'returnFieldJS')) {
-                               $resultArray['extJSCODE'] .= LF . 'TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {' . $evalObj->returnFieldJS() . '}';
+                               $resultArray['extJSCODE'] .= LF . 'TBE_EDITOR.customEvalFunctions[' . GeneralUtility::quoteJSvalue($evalData) . '] = function(value) {' . $evalObj->returnFieldJS() . '}';
                        }
                }