From 13d6480541779544b40b02b8952f04c5c21e59e9 Mon Sep 17 00:00:00 2001 From: Daniel Windloff Date: Fri, 25 Sep 2020 11:37:42 +0200 Subject: [PATCH] [TASK] Recordlist: Replace BackendUtility::getLinkToDataHandlerAction Replace BackendUtility::getLinkToDataHandlerAction and use the uriBuilder instead. Releases: master Resolves: #92407 Change-Id: I96b2f1698aa5dcf056fa24fd548c01cc3fb4ce6f Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65873 Tested-by: Andreas Fernandez Tested-by: TYPO3com Tested-by: Christian Kuhn Reviewed-by: Andreas Fernandez Reviewed-by: Christian Kuhn --- .../Controller/RecordListController.php | 9 +++--- .../Classes/RecordList/DatabaseRecordList.php | 32 ++++++++++++------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/typo3/sysext/recordlist/Classes/Controller/RecordListController.php b/typo3/sysext/recordlist/Classes/Controller/RecordListController.php index 2f58f2943381..9086f21907cf 100644 --- a/typo3/sysext/recordlist/Classes/Controller/RecordListController.php +++ b/typo3/sysext/recordlist/Classes/Controller/RecordListController.php @@ -450,11 +450,10 @@ protected function languageSelector(int $id): string 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI') ]; $redirectUrl = (string)$this->uriBuilder->buildUriFromRoute('record_edit', $parameters); - $targetUrl = BackendUtility::getLinkToDataHandlerAction( - '&cmd[pages][' . $id . '][localize]=' . $languageUid, - $redirectUrl - ); - + $params = []; + $params['redirect'] = $redirectUrl; + $params['cmd']['pages'][$id]['localize'] = $languageUid; + $targetUrl = (string)$this->uriBuilder->buildUriFromRoute('tce_db', $params); $output .= ''; } diff --git a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php index c81329d36cf5..08067dec28a1 100644 --- a/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php +++ b/typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php @@ -1846,8 +1846,10 @@ public function makeControl($table, $row) if ($permsEdit && $GLOBALS['TCA'][$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) { if (!$isL10nOverlay && !$isDeletePlaceHolder && isset($this->currentTable['prev'][$row['uid']])) { // Up - $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prev'][$row['uid']]; - $url = BackendUtility::getLinkToDataHandlerAction($params, $this->listURL()); + $params = []; + $params['redirect'] = $this->listURL(); + $params['cmd'][$table][$row['uid']]['move'] = $this->currentTable['prev'][$row['uid']]; + $url = (string)$this->uriBuilder->buildUriFromRoute('tce_db', $params); $moveUpAction = '' . $this->iconFactory->getIcon('actions-move-up', Icon::SIZE_SMALL)->render() . ''; } else { @@ -1857,8 +1859,10 @@ public function makeControl($table, $row) if (!$isL10nOverlay && !$isDeletePlaceHolder && $this->currentTable['next'][$row['uid']]) { // Down - $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['next'][$row['uid']]; - $url = BackendUtility::getLinkToDataHandlerAction($params, $this->listURL()); + $params = []; + $params['redirect'] = $this->listURL(); + $params['cmd'][$table][$row['uid']]['move'] = $this->currentTable['next'][$row['uid']]; + $url = (string)$this->uriBuilder->buildUriFromRoute('tce_db', $params); $moveDownAction = '' . $this->iconFactory->getIcon('actions-move-down', Icon::SIZE_SMALL)->render() . ''; } else { @@ -1937,8 +1941,10 @@ public function makeControl($table, $row) // Up (Paste as the page right after the current parent page) if ($this->calcPerms->createPagePermissionIsGranted()) { if (!$isDeletePlaceHolder && !$isL10nOverlay) { - $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . -$this->id; - $url = BackendUtility::getLinkToDataHandlerAction($params, $this->listURL()); + $params = []; + $params['redirect'] = $this->listURL(); + $params['cmd'][$table][$row['uid']]['move'] = -$this->id; + $url = (string)$this->uriBuilder->buildUriFromRoute('tce_db', $params); $moveLeftAction = '' . $this->iconFactory->getIcon('actions-move-left', Icon::SIZE_SMALL)->render() . ''; $this->addActionToCellGroup($cells, $moveLeftAction, 'moveLeft'); @@ -1950,8 +1956,10 @@ public function makeControl($table, $row) if (!$isL10nOverlay && !$isDeletePlaceHolder && $this->currentTable['prevUid'][$row['uid']]) { $localCalcPerms = new Permission($backendUser->calcPerms(BackendUtility::getRecord('pages', $this->currentTable['prevUid'][$row['uid']]))); if ($localCalcPerms->createPagePermissionIsGranted()) { - $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prevUid'][$row['uid']]; - $url = BackendUtility::getLinkToDataHandlerAction($params, $this->listURL()); + $params = []; + $params['redirect'] = $this->listURL(); + $params['cmd'][$table][$row['uid']]['move'] = $this->currentTable['prevUid'][$row['uid']]; + $url = (string)$this->uriBuilder->buildUriFromRoute('tce_db', $params); $moveRightAction = '' . $this->iconFactory->getIcon('actions-move-right', Icon::SIZE_SMALL)->render() . ''; } else { @@ -2201,10 +2209,10 @@ public function makeLocalizationPanel($table, $row, array $translations): string 'returnUrl' => $this->listURL() ] ); - $href = BackendUtility::getLinkToDataHandlerAction( - '&cmd[' . $table . '][' . $row['uid'] . '][localize]=' . $lUid_OnPage, - $redirectUrl - ); + $params = []; + $params['redirect'] = $redirectUrl; + $params['cmd'][$table][$row['uid']]['localize'] = $lUid_OnPage; + $href = (string)$this->uriBuilder->buildUriFromRoute('tce_db', $params); $language = BackendUtility::getRecord('sys_language', $lUid_OnPage, 'title'); if ($this->languageIconTitles[$lUid_OnPage]['flagIcon']) { $lC = $this->iconFactory->getIcon($this->languageIconTitles[$lUid_OnPage]['flagIcon'], Icon::SIZE_SMALL)->render();