[BUGFIX] Replace forgotten back button to new button API 22/53722/2
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 17 Aug 2017 12:36:55 +0000 (14:36 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Mon, 6 Nov 2017 09:04:08 +0000 (10:04 +0100)
With #69884 the new button API was introduced but the back button
in DatabaseRecordList was forgotten. The button is now done with
the new API.

Resolves: #82056
Releases: master
Change-Id: Icc6480af3a1b4a04e7222dc92cdb58bf9549007d
Reviewed-on: https://review.typo3.org/53722
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Tiefenbrunn <georg.tiefenbrunn@gmail.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Georg Tiefenbrunn <georg.tiefenbrunn@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 3d5f0c7..9465d4c 100644 (file)
@@ -884,10 +884,11 @@ class DatabaseRecordList
             }
             // Back
             if ($this->returnUrl) {
-                $href = htmlspecialchars(GeneralUtility::linkThisUrl($this->returnUrl, ['id' => $this->id]));
-                $buttons['back'] = '<a href="' . $href . '" class="typo3-goBack" title="'
-                    . htmlspecialchars($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.goBack')) . '">'
-                    . $this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL) . '</a>';
+                $backButton = $buttonBar->makeLinkButton()
+                    ->setHref($this->returnUrl)
+                    ->setTitle($lang->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.goBack'))
+                    ->setIcon($this->iconFactory->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
+                $buttonBar->addButton($backButton, ButtonBar::BUTTON_POSITION_LEFT);
             }
         }
     }