[BUGFIX] URI to mass edit form is wrong in clip pane mode 78/43678/5
authorMichael Oehlhof <typo3@oehlhof.de>
Wed, 30 Sep 2015 22:53:52 +0000 (00:53 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 6 Oct 2015 07:13:06 +0000 (09:13 +0200)
When trying to mass edit fields of certain records selected
via the clip pane checkbox mode, an invalid GET argument
gets built in the DatabaseRecordList.

This patch removes the superfluous argument.

Resolves: #70226
Releases: master
Change-Id: I7f000c1a0fff275ebb55d58caa68a87986d31fdc
Reviewed-on: http://review.typo3.org/43678
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Tested-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Josef Glatz <jousch@gmail.com>
Tested-by: Josef Glatz <jousch@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 517edac..de7bf59 100644 (file)
@@ -1008,8 +1008,14 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                                        if ($this->clipNumPane()) {
                                                                $editIdList = '\'+editList(\'' . $table . '\',\'' . $editIdList . '\')+\'';
                                                        }
-                                                       $params = '&edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . implode(',', $this->fieldArray);
-                                                       $icon .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1))
+                                                       $params = 'edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . implode(',', $this->fieldArray);
+                                                       // we need to build this uri differently, otherwise GeneralUtility::quoteJSvalue messes up the edit list function
+                                                       $onClick = BackendUtility::editOnClick('', '', -1);
+                                                       $onClickArray = explode('?', $onClick, 2);
+                                                       $lastElement = array_pop($onClickArray);
+                                                       array_push($onClickArray, $params . '&' . $lastElement);
+                                                       $onClick = implode('?', $onClickArray);
+                                                       $icon .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick)
                                                                . '" title="' . $lang->getLL('editShownColumns', TRUE) . '">'
                                                                . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                                                        $icon = '<div class="btn-group" role="group">' . $icon . '</div>';
@@ -1048,9 +1054,15 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                                        if ($this->clipNumPane()) {
                                                                $editIdList = '\'+editList(\'' . $table . '\',\'' . $editIdList . '\')+\'';
                                                        }
-                                                       $params = '&edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . $fCol;
+                                                       $params = 'edit[' . $table . '][' . $editIdList . ']=edit&columnsOnly=' . $fCol;
+                                                       // we need to build this uri differently, otherwise GeneralUtility::quoteJSvalue messes up the edit list function
+                                                       $onClick = BackendUtility::editOnClick('', '', -1);
+                                                       $onClickArray = explode('?', $onClick, 2);
+                                                       $lastElement = array_pop($onClickArray);
+                                                       array_push($onClickArray, $params . '&' . $lastElement);
+                                                       $onClick = implode('?', $onClickArray);
                                                        $iTitle = sprintf($lang->getLL('editThisColumn'), $sortLabel);
-                                                       $theData[$fCol] .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1))
+                                                       $theData[$fCol] .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick)
                                                                . '" title="' . htmlspecialchars($iTitle) . '">'
                                                                . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
                                                }