Skip to content

Commit 778b442

Browse files
benjaminkottandreaskienast
authored andcommitted
[BUGFIX] Apply options.showHistory default in EditDocumentController
The User TSConfig "showHistory" feature is considered to be active by default in DatabaseRecordList and ContextMenu providers. Align the EditDocumentController to use the same algorithm for evaluating the `options.showHistory` setting. Resolves: #105763 Releases: main, 13.4 Change-Id: I54c5cae21a1a06f38faf67cb45366ad9d5e6003d Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/87358 Tested-by: Andreas Kienast <akienast@scripting-base.de> Reviewed-by: Benjamin Franzke <ben@bnf.dev> Tested-by: Benjamin Franzke <ben@bnf.dev> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Andreas Kienast <akienast@scripting-base.de>
1 parent 1da2ab9 commit 778b442

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

typo3/sysext/backend/Classes/Controller/EditDocumentController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,9 +1637,10 @@ protected function registerInfoButtonToButtonBar(ButtonBar $buttonBar, string $p
16371637
*/
16381638
protected function registerHistoryButtonToButtonBar(ButtonBar $buttonBar, string $position, int $group): void
16391639
{
1640+
$userTsConfig = $this->getBackendUser()->getTSConfig();
16401641
if ($this->isSingleRecordView()
16411642
&& !empty($this->firstEl['table'])
1642-
&& $this->getTsConfigOption($this->firstEl['table'], 'showHistory')
1643+
&& (bool)trim($userTsConfig['options.']['showHistory.'][$this->firstEl['table']] ?? $userTsConfig['options.']['showHistory'] ?? '1')
16431644
) {
16441645
$historyUrl = (string)$this->uriBuilder->buildUriFromRoute('record_history', [
16451646
'element' => $this->firstEl['table'] . ':' . $this->firstEl['uid'],

0 commit comments

Comments
 (0)