[BUGFIX] requestUpdate sensitive to spaces 88/22188/2
authorFrancois Suter <francois@typo3.org>
Wed, 10 Jul 2013 12:12:32 +0000 (14:12 +0200)
committerFrancois Suter <francois@typo3.org>
Wed, 10 Jul 2013 20:47:23 +0000 (22:47 +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.

Resolves: #42789
Releases: 6.2, 6.1, 6.0, 4.7, 4.5
Change-Id: I340090e93e7b8645493f8db0c8c374cb1227f684
Reviewed-on: https://review.typo3.org/22188
Reviewed-by: Francois Suter
Tested-by: Francois Suter
t3lib/class.t3lib_tceforms.php

index 4a273f8..86896a6 100644 (file)
@@ -847,7 +847,8 @@ class t3lib_TCEforms {
                                        // 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 (
                                        ($TCA[$table]['ctrl']['type'] && !strcmp($field, $TCA[$table]['ctrl']['type'])) ||
-                                       ($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'], $field))) {
+                                       ($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList(str_replace(' ', '', $GLOBALS['TCA'][$table]['ctrl']['requestUpdate']), $field))
+                               ) {
                                        if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
                                                $alertMsgOnChange = 'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
                                        } else {