[BUGFIX] Allow edit popup wizard to select a record 22/43622/3
authorBenjamin Mack <benni@typo3.org>
Tue, 29 Sep 2015 11:08:16 +0000 (13:08 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 29 Sep 2015 11:23:35 +0000 (13:23 +0200)
Resolves: #70167
Releases: master
Change-Id: Idf41369b956bc868f861353bae11dbd506069dbd
Reviewed-on: http://review.typo3.org/43622
Reviewed-by: Robert van Kammen <rvkammen@hotmail.com>
Tested-by: Robert van Kammen <rvkammen@hotmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php
typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js

index cb983ec..94935d0 100644 (file)
@@ -295,7 +295,7 @@ abstract class AbstractFormElement extends AbstractNode {
                                        if (isset($wizardConfiguration['popup_onlyOpenIfSelected']) && $wizardConfiguration['popup_onlyOpenIfSelected']) {
                                                $notSelectedText = $languageService->sL('LLL:EXT:lang/locallang_core.xlf:mess.noSelItemForEdit');
                                                $onlyIfSelectedJS =
-                                                       'if (!TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName . $listFlag) . ')){' .
+                                                       'if (!TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName) . ')){' .
                                                                'alert(' . GeneralUtility::quoteJSvalue($notSelectedText) . ');' .
                                                                'return false;' .
                                                        '}';
@@ -306,7 +306,7 @@ abstract class AbstractFormElement extends AbstractNode {
                                                'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url) . '+\'&P[currentValue]=\'+TBE_EDITOR.rawurlencode(' .
                                                                'document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value,200' .
                                                        ')' .
-                                                       '+\'&P[currentSelectedValues]=\'+TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName . $listFlag) . '),' .
+                                                       '+\'&P[currentSelectedValues]=\'+TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName) . '),' .
                                                        GeneralUtility::quoteJSvalue('popUp' . $md5ID) . ',' .
                                                        GeneralUtility::quoteJSvalue($wizardConfiguration['JSopenParams']) .
                                                ');' .
@@ -351,7 +351,7 @@ abstract class AbstractFormElement extends AbstractNode {
                                                'vHWin=window.open('. GeneralUtility::quoteJSvalue($url) . '+\'&P[currentValue]=\'+TBE_EDITOR.rawurlencode(' .
                                                        'document.editform[' . GeneralUtility::quoteJSvalue($itemName) . '].value,200' .
                                                        ')' .
-                                                       '+\'&P[currentSelectedValues]=\'+TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName . $listFlag) . '),' .
+                                                       '+\'&P[currentSelectedValues]=\'+TBE_EDITOR.curSelected(' . GeneralUtility::quoteJSvalue($itemName) . '),' .
                                                        GeneralUtility::quoteJSvalue('popUp' . $md5ID) . ',' .
                                                        GeneralUtility::quoteJSvalue($wizardConfiguration['JSopenParams']) .
                                                ');' .
index dd23dd6..c3ac59f 100644 (file)
@@ -276,7 +276,7 @@ var TBE_EDITOR = {
                return (theStr.substring(sPos+lengthOfDelim,ePos));
        },
        curSelected: function(theField) {
-               var fObjSel = document[TBE_EDITOR.formname][theField];
+               var fObjSel = TYPO3.jQuery('select[data-formengine-input-name="' + theField + '"]').get(0);
                var retVal="";
                if (fObjSel) {
                        if (fObjSel.type=='select-multiple' || fObjSel.type=='select-one') {