diff --git a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php index 8f8a4f5d342175f68a669a50977cafb0d6b958e6..6cf459b77aff36e2629566e85201ccd87442e479 100644 --- a/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php +++ b/typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php @@ -333,6 +333,7 @@ class ElementHistoryController $singleLine['title'] = $this->generateTitle($entry['tablename'], $entry['recuid']); $singleLine['elementUrl'] = $this->buildUrl(['element' => $entry['tablename'] . ':' . $entry['recuid']]); + $singleLine['actiontype'] = $entry['actiontype']; if ((int)$entry['actiontype'] === RecordHistoryStore::ACTION_MODIFY) { // show changes if (!$this->showDiff) { diff --git a/typo3/sysext/backend/Classes/History/RecordHistory.php b/typo3/sysext/backend/Classes/History/RecordHistory.php index e6f2d9c620dfdc085e64a8566b038d14a84486ea..da43799239fea0beaf7aa9511a9772017f9d77c2 100644 --- a/typo3/sysext/backend/Classes/History/RecordHistory.php +++ b/typo3/sysext/backend/Classes/History/RecordHistory.php @@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\DataHandling\DataHandler; use TYPO3\CMS\Core\History\RecordHistoryStore; +use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Utility\GeneralUtility; /** @@ -534,10 +535,27 @@ class RecordHistory } if (!isset($this->pageAccessCache[$pageId])) { - $this->pageAccessCache[$pageId] = BackendUtility::readPageAccess( - $pageId, - $this->getBackendUser()->getPagePermsClause(1) - ); + $isDeletedPage = false; + if (isset($GLOBALS['TCA']['pages']['ctrl']['delete'])) { + $deletedField = $GLOBALS['TCA']['pages']['ctrl']['delete']; + $pageRecord = BackendUtility::getRecord('pages', $pageId, $deletedField, '', false); + $isDeletedPage = (bool)$pageRecord[$deletedField]; + } + if ($isDeletedPage) { + // The page is deleted, so we fake its uid to be the one of the parent page. + // By doing so, the following API will use this id to traverse the rootline + // and check whether it is in the users' web mounts. + // We check however if the user has (or better had) access to the deleted page itself. + // Since the only way we got here is by requesting the history of the parent page + // we can be sure this parent page actually exists. + $pageRecord['uid'] = $pageRecord['pid']; + $this->pageAccessCache[$pageId] = $this->getBackendUser()->doesUserHaveAccess($pageRecord, Permission::PAGE_SHOW); + } else { + $this->pageAccessCache[$pageId] = BackendUtility::readPageAccess( + $pageId, + $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW) + ); + } } return $this->pageAccessCache[$pageId] !== false; diff --git a/typo3/sysext/backend/Resources/Private/Partials/RecordHistory/History.html b/typo3/sysext/backend/Resources/Private/Partials/RecordHistory/History.html index dc39b3beb7fb93e9b6690d796872dfe991ae8f41..84963790ae8b1460c8d5b5bc7c8f18dbc7b6450e 100644 --- a/typo3/sysext/backend/Resources/Private/Partials/RecordHistory/History.html +++ b/typo3/sysext/backend/Resources/Private/Partials/RecordHistory/History.html @@ -35,7 +35,7 @@ <f:if condition="{historyRow.originalBackendUserName}"> ({f:translate(key: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:viaUser')} {historyRow.originalBackendUserName})</f:if> </td> <td> - <a href="{elementUrl}" title="{f:translate('LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:linkRecordHistory')}">{historyRow.title}</a> + <a href="{elementUrl}" title="{f:translate(id: 'LLL:EXT:backend/Resources/Private/Language/locallang_show_rechis.xlf:linkRecordHistory')}">{historyRow.title -> f:format.raw()}</a> </td> <td> <f:switch expression="{historyRow.actiontype}">