[BUGFIX] Error on trying to edit selected records in list module 84/42084/3
authorFrank Nägler <frank.naegler@typo3.org>
Wed, 29 Jul 2015 10:25:56 +0000 (12:25 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 29 Jul 2015 21:42:02 +0000 (23:42 +0200)
Add additional Javascript to the edit link after
BackendUtility::editOnClick was called. This is needed because the
assigned parameter is encoded.

Resolves: #68604
Releases: master
Change-Id: Ia05e4b4a4ed26dd0b0c3e229369ef9b07b11cf3e
Reviewed-on: http://review.typo3.org/42084
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index fd97363..ca96353 100644 (file)
@@ -905,9 +905,13 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                                                // The "edit marked" link:
                                                $editIdList = implode(',', $currentIdList);
                                                $editIdList = '\'+editList(\'' . $table . '\',\'' . $editIdList . '\')+\'';
-                                               $params = '&edit[' . $table . '][' . $editIdList . ']=edit';
-                                               $onClick = htmlspecialchars(BackendUtility::editOnClick($params, '', -1));
-                                               $cells['edit'] = '<a class="btn btn-default" href="#" onclick="' . $onClick . '" title="'
+                                               $params = 'edit[' . $table . '][' . $editIdList . ']=edit';
+                                               $onClick = BackendUtility::editOnClick('', '', -1);
+                                               $onClickArray = explode('?', $onClick, 2);
+                                               $lastElement = array_pop($onClickArray);
+                                               array_push($onClickArray, $params . '&' . $lastElement);
+                                               $onClick = implode('?', $onClickArray);
+                                               $cells['edit'] = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="'
                                                        . $lang->getLL('clip_editMarked', TRUE) . '">'
                                                        . IconUtility::getSpriteIcon('actions-document-open') . '</a>';
                                                // The "Delete marked" link: