[BUGFIX] requestUpdate sensitive to spaces 83/22283/3
authorWouter Wolters <typo3@wouterwolters.nl>
Sat, 13 Jul 2013 17:26:28 +0000 (19:26 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Sun, 14 Jul 2013 20:50:50 +0000 (22:50 +0200)
The TCA property "requestUpdate" is sensitive to spaces, although this
is documented nowhere. Indeed "foo1, foo2" will not work whereas
"foo1,foo2" does. This patch strips spaces from the "requestUpdate"
string before testing it.

Change-Id: Ifbb1fe5be59077207316e48204d65a978592f878
Resolves: #49872
Related: #42789
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Reviewed-on: https://review.typo3.org/22283
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Frans Saris
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/Form/Element/TreeElement.php

index 232631b..51c0aff 100644 (file)
@@ -140,7 +140,12 @@ class TreeElement {
                }
                // Create a JavaScript code line which will ask the user to save/update the form due to changing the element.
                // This is used for eg. "type" fields and others configured with "requestUpdate"
-               if ($GLOBALS['TCA'][$table]['ctrl']['type'] && !strcmp($field, $GLOBALS['TCA'][$table]['ctrl']['type']) || $GLOBALS['TCA'][$table]['ctrl']['requestUpdate'] && GeneralUtility::inList($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'], $field)) {
+               if (
+                       $GLOBALS['TCA'][$table]['ctrl']['type']
+                       && !strcmp($field, $GLOBALS['TCA'][$table]['ctrl']['type'])
+                       || $GLOBALS['TCA'][$table]['ctrl']['requestUpdate']
+                       && GeneralUtility::inList(str_replace(' ', '', $GLOBALS['TCA'][$table]['ctrl']['requestUpdate'], $field))
+               ) {
                        if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
                                $onChange .= 'if (confirm(TBE_EDITOR.labels.onChangeAlert) && ' . 'TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
                        } else {