[BUGFIX] Request update broken for select fields 44/30044/2
authorFrancois Suter <francois@typo3.org>
Tue, 13 May 2014 11:09:32 +0000 (13:09 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 3 Jun 2014 14:20:55 +0000 (16:20 +0200)
For select-type fields displayed as two side-by-side selectors
which are registered as "requestUpdate" fields, the form submission
happens before the value is copied to the left-hand selector.
The form is thus saved without value.

Full description in the bug report, which also contains a
test extension and steps to reproduce.

Resolves: #58755
Releases: 6.2
Change-Id: Ie94def723537202287655c650cee7dfa09815f4f
Reviewed-on: https://review.typo3.org/30044
Reviewed-by: Peter Foerger
Reviewed-by: Fabien Udriot
Tested-by: Fabien Udriot
Reviewed-by: Tomas Norre Mikkelsen
Reviewed-by: Lorenz Ulrich
Tested-by: Lorenz Ulrich
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js

index e53c185..7cf8714 100644 (file)
@@ -482,7 +482,10 @@ var TBE_EDITOR = {
                if (TBE_EDITOR.doSaveFieldName) {
                        document[TBE_EDITOR.formname][TBE_EDITOR.doSaveFieldName].value=1;
                }
-               document[TBE_EDITOR.formname].submit();
+               // Set a short timeout to allow other JS processes to complete, in particular those from
+               // EXT:backend/Resources/Public/JavaScript/FormEngine.js (reference: http://forge.typo3.org/issues/58755).
+               // TODO: This should be solved in a better way when this script is refactored.
+               window.setTimeout('document[TBE_EDITOR.formname].submit()', 10);
        },
        split: function(theStr1, delim, index) {
                var theStr = ""+theStr1;