Skip to content

Commit

Permalink
[BUGFIX] Do not crash referenceindex:update with deleted pages
Browse files Browse the repository at this point in the history
The TYPO3 reference index updater runs on deleted pages.

When such a page is checked, the following exception occurs:

 Could not fetch page data for uid 2043.
 at typo3/sysext/core/Classes/Utility/RootlineUtility.php:258

This patch prevents loading the form when the page has been deleted,
thus preventing to load the rootline of a non-existing page.

----

The exception may happen on two code paths:

Exception trace 1:

 TYPO3\CMS\Core\Utility\RootlineUtility->getRecordArray()
 TYPO3\CMS\Core\Utility\RootlineUtility->generateRootlineCache()
 TYPO3\CMS\Core\Utility\RootlineUtility->get()
 FluidTYPO3\Flux\Service\PageService->getPageTemplateConfiguration()
 FluidTYPO3\Flux\Provider\PageProvider->getControllerActionReferenceFromRecord()
 FluidTYPO3\Flux\Provider\PageProvider->getControllerExtensionKeyFromRecord()
 FluidTYPO3\Flux\Provider\AbstractProvider->getControllerPackageNameFromRecord()
 FluidTYPO3\Flux\Provider\AbstractProvider->resolveFormClassName()
 FluidTYPO3\Flux\Provider\AbstractProvider->createCustomFormInstance()
 FluidTYPO3\Flux\Provider\AbstractProvider->getForm()
 FluidTYPO3\Flux\Provider\PageProvider->getForm()
 FluidTYPO3\Flux\Integration\HookSubscribers\DynamicFlexForm->parseDataStructureByIdentifierPreProcess()
 TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools->parseDataStructureByIdentifier()
 TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools->traverseFlexFormXMLData()
 TYPO3\CMS\Core\Database\ReferenceIndex->getRelations()

Exception trace 2:
 TYPO3\CMS\Core\Utility\RootlineUtility->getRecordArray()
 TYPO3\CMS\Core\Utility\RootlineUtility->generateRootlineCache()
 TYPO3\CMS\Core\Utility\RootlineUtility->get()
 FluidTYPO3\Flux\Provider\PageProvider->loadRecordTreeFromDatabase()
 FluidTYPO3\Flux\Provider\PageProvider->getInheritanceTree()
 FluidTYPO3\Flux\Provider\PageProvider->getInheritedConfiguration()
 FluidTYPO3\Flux\Provider\PageProvider->setDefaultValuesInFieldsWithInheritedValues()
 FluidTYPO3\Flux\Provider\PageProvider->getForm()
 FluidTYPO3\Flux\Integration\HookSubscribers\DynamicFlexForm->parseDataStructureByIdentifierPreProcess()
 TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools->parseDataStructureByIdentifier()
 TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools->traverseFlexFormXMLData()
 TYPO3\CMS\Core\Database\ReferenceIndex->getRelations()
  • Loading branch information
cweiske authored and NamelessCoder committed Oct 24, 2022
1 parent e77db94 commit bf6ae95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Provider/PageProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public function injectPageConfigurationService(FluxService $pageConfigurationSer
*/
public function getForm(array $row)
{
if ($row['deleted']) {
return null;
}
$form = parent::getForm($row);
if ($form) {
$form->setOption(PreviewView::OPTION_PREVIEW, [PreviewView::OPTION_MODE => 'none']);
Expand Down

0 comments on commit bf6ae95

Please sign in to comment.