[BUGFIX] Fixed broken select wizard 42/43442/3
authorMichael Oehlhof <typo3@oehlhof.de>
Sun, 20 Sep 2015 17:27:24 +0000 (19:27 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 22 Sep 2015 18:23:05 +0000 (20:23 +0200)
Resolves: #69826
Releases: master
Change-Id: If88662cc024023f829411e062dddf74e1ef2bda3
Reviewed-on: http://review.typo3.org/43442
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php

index f919443..cb983ec 100644 (file)
@@ -425,17 +425,16 @@ abstract class AbstractFormElement extends AbstractNode {
                                                $options[] = '<option value="' . htmlspecialchars($selectWizardItem[1]) . '">' . htmlspecialchars($selectWizardItem[0]) . '</option>';
                                        }
                                        if ($wizardConfiguration['mode'] == 'append') {
-                                               $assignValue = 'document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value=\'\'+this.options[this.selectedIndex].value+document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value';
+                                               $assignValue = 'document.querySelectorAll(' . GeneralUtility::quoteJSvalue('[data-formengine-input-name="' . $itemName . '"]') . ')[0].value=\'\'+this.options[this.selectedIndex].value+document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value';
                                        } elseif ($wizardConfiguration['mode'] == 'prepend') {
-                                               $assignValue = 'document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value+=\'\'+this.options[this.selectedIndex].value';
+                                               $assignValue = 'document.querySelectorAll(' . GeneralUtility::quoteJSvalue('[data-formengine-input-name="' . $itemName . '"]') . ')[0].value+=\'\'+this.options[this.selectedIndex].value';
                                        } else {
-                                               $assignValue = 'document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value=this.options[this.selectedIndex].value';
+                                               $assignValue = 'document.querySelectorAll(' . GeneralUtility::quoteJSvalue('[data-formengine-input-name="' . $itemName . '"]') . ')[0].value=this.options[this.selectedIndex].value';
                                        }
                                        $otherWizards[] =
                                                '<select' .
                                                        ' id="' . StringUtility::getUniqueId('tceforms-select-') . '"' .
                                                        ' class="form-control tceforms-select tceforms-wizardselect"' .
-                                                       ' name="_WIZARD' . $fName . '"' .
                                                        ' onchange="' . htmlspecialchars($assignValue . ';this.blur();this.selectedIndex=0;' . implode('', $fieldChangeFunc)) . '"'.
                                                '>' .
                                                        implode('', $options) .