Project

General

Profile

Actions

Bug #106798

closed

Opening pid=0 with module list leads do Exception: Call to a member function getName() on null in PersistedPatternMapper.php

Added by Benjamin Franzke 23 days ago. Updated 23 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2025-05-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
14
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Happens since:

89008: [TASK] Migrate EXT:core to Schema API | https://review.typo3.org/c/Packages/TYPO3.CMS/+/89008

(1/1) Error
Call to a member function getName() on null

in /var/www/html/TYPO3.CMS/typo3/sysext/core/Classes/Routing/Aspect/PersistedPatternMapper.php line 139
        $this->routeFieldResultNames = $routeFieldResultNames['fieldName'] ?? [];
        $schema = GeneralUtility::makeInstance(TcaSchemaFactory::class)->get($this->tableName);
        if ($schema->isLanguageAware()) {
            $this->languageFieldName = $schema->getCapability(TcaSchemaCapability::Language)->getLanguageField()->getName();
            $this->languageParentFieldName = $schema->getCapability(TcaSchemaCapability::Language)->getTranslationSourceField()->getName();
        } else {
            $this->languageFieldName = null;
            $this->languageParentFieldName = null;
        }
at TYPO3\CMS\Core\Routing\Aspect\PersistedPatternMapper->__construct()
in /var/www/html/TYPO3.CMS/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2831
            return self::$container->get($className);
        }

        // Create new instance and call constructor with parameters
        $instance = new $finalClassName(...$constructorArguments);
        // Register new singleton instance, but only if it is not a known PSR-11 container service
        if ($instance instanceof SingletonInterface && !(self::$container !== null && self::$container->has($className))) {
            self::$singletonInstances[$finalClassName] = $instance;
        }
at TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance()
in /var/www/html/TYPO3.CMS/typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php line 66
            throw new \OutOfRangeException(sprintf('No aspect found for %s', $type), 1538079482);
        }
        unset($settings['type']);
        $className = $GLOBALS['TYPO3_CONF_VARS']['SYS']['routing']['aspects'][$type];
        return GeneralUtility::makeInstance($className, $settings);
    }

    /**
     * Checks for the language aware trait, and adds the site language.
at TYPO3\CMS\Core\Routing\Aspect\AspectFactory->create()
in /var/www/html/TYPO3.CMS/typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php line 41
    {
        $aspects = array_map(
            function ($settings) use ($language, $site) {
                $type = (string)($settings['type'] ?? '');
                $aspect = $this->create($type, $settings);
                return $this->enrich($aspect, $language, $site);
            },
            $aspects
        );
at TYPO3\CMS\Core\Routing\Aspect\AspectFactory->TYPO3\CMS\Core\Routing\Aspect\{closure}()
at array_map()
in /var/www/html/TYPO3.CMS/typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php line 38
     * @return AspectInterface[]
     */
    public function createAspects(array $aspects, SiteLanguage $language, Site $site): array
    {
        $aspects = array_map(
            function ($settings) use ($language, $site) {
                $type = (string)($settings['type'] ?? '');
                $aspect = $this->create($type, $settings);
                return $this->enrich($aspect, $language, $site);
at TYPO3\CMS\Core\Routing\Aspect\AspectFactory->createAspects()
in /var/www/html/TYPO3.CMS/typo3/sysext/core/Classes/Routing/PageRouter.php line 476
            }
            $enhancerType = $enhancerConfiguration['type'] ?? '';
            $enhancer = $this->enhancerFactory->create($enhancerType, $enhancerConfiguration);
            if (!empty($enhancerConfiguration['aspects'] ?? null)) {
                $aspects = $this->aspectFactory->createAspects(
                    $enhancerConfiguration['aspects'],
                    $language,
                    $this->site
                );
at TYPO3\CMS\Core\Routing\PageRouter->getEnhancersForPage()
in /var/www/html/TYPO3.CMS/typo3/sysext/core/Classes/Routing/PageRouter.php line 314
        $collection->add('default', $defaultRouteForPage);

        // cHash is never considered because cHash is built by this very method.
        unset($originalParameters['cHash']);
        $enhancers = $this->getEnhancersForPage($pageId, $language);
        foreach ($enhancers as $enhancer) {
            if ($enhancer instanceof RoutingEnhancerInterface) {
                $enhancer->enhanceForGeneration($collection, $originalParameters);
            }
at TYPO3\CMS\Core\Routing\PageRouter->generateUri()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/Routing/PreviewUriBuilder.php line 217
                    if ($event->getLanguageId() > 0) {
                        $previewRouteParameters['_language'] = $site->getLanguageById($event->getLanguageId());
                    }
                    $event->setPreviewUri(
                        $site->getRouter($event->getContext())->generateUri(
                            $event->getPageId(),
                            $previewRouteParameters,
                            $event->getSection(),
                            RouterInterface::ABSOLUTE_URL
at TYPO3\CMS\Backend\Routing\PreviewUriBuilder->buildUri()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/Routing/PreviewUriBuilder.php line 312

    protected function buildAttributes(?array $options = null): ?array
    {
        $options = $this->enrichOptions($options);
        if (null === ($uri = $this->buildUri($options))) {
            return null;
        }
        $args = [
            // target URI
at TYPO3\CMS\Backend\Routing\PreviewUriBuilder->buildAttributes()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/Routing/PreviewUriBuilder.php line 270
     * @param array|null $options
     */
    public function buildDispatcherAttributes(?array $options = null): ?array
    {
        if (null === ($attributes = $this->buildAttributes($options))) {
            return null;
        }
        $this->loadActionDispatcher();
        return $this->prefixAttributeNames('data-dispatch-', $attributes);
at TYPO3\CMS\Backend\Routing\PreviewUriBuilder->buildDispatcherAttributes()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/Routing/PreviewUriBuilder.php line 284
     * @param array|null $options
     */
    public function serializeDispatcherAttributes(?array $options = null): ?string
    {
        if (null === ($attributes = $this->buildDispatcherAttributes($options))) {
            return null;
        }
        return ' ' . GeneralUtility::implodeAttributes($attributes, true);
    }
at TYPO3\CMS\Backend\Routing\PreviewUriBuilder->serializeDispatcherAttributes()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php line 1604
                && !in_array((int)$this->pageRow['doktype'], $this->getNoViewWithDokTypes($tsConfig), true)
            )
        ) {
            if (!$isDeletePlaceHolder
                && ($attributes = $this->getPreviewUriBuilder($table, $row)->serializeDispatcherAttributes()) !== null
            ) {
                $viewAction = '<button'
                    . ' type="button"'
                    . ' class="btn btn-default" ' . $attributes
at TYPO3\CMS\Backend\RecordList\DatabaseRecordList->makeControl()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php line 1237
                $theData[$fCol] = $this->recPath($row['pid']);
            } elseif ($fCol === '_REF_') {
                $theData[$fCol] = $this->generateReferenceToolTip($table, $row['uid']);
            } elseif ($fCol === '_CONTROL_') {
                $theData[$fCol] = $this->makeControl($table, $row);
            } elseif ($fCol === '_LOCALIZATION_') {
                // Language flag an title
                $theData[$fCol] = $this->languageFlag($table, $row);
                // Localize record
at TYPO3\CMS\Backend\RecordList\DatabaseRecordList->renderListRow()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php line 793
                            $translationEnabled = true;
                            $translations = $translationsRaw['translations'] ?? [];
                        }
                    }
                    $rowOutput .= $this->renderListRow($table, $row, 0, $translations, $translationEnabled);
                    if ($listTranslatedRecords) {
                        foreach ($translations ?? [] as $lRow) {
                            if (!$this->isRowListingConditionFulfilled($table, $lRow)) {
                                continue;
at TYPO3\CMS\Backend\RecordList\DatabaseRecordList->getTable()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/RecordList/DatabaseRecordList.php line 2420
    {
        $tableNames = $this->getTablesToRender();
        $output = '';
        foreach ($tableNames as $tableName) {
            $output .= $this->getTable($tableName);
        }
        return $output;
    }

at TYPO3\CMS\Backend\RecordList\DatabaseRecordList->generateList()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/Controller/RecordListController.php line 180
            if ($cmd === 'delete' && $request->getMethod() === 'POST') {
                $this->deleteRecords($request, $clipboard);
            }
            $dbList->start($this->id, $this->table, $pointer, $this->searchTerm, $search_levels);
            $tableListHtml = $dbList->generateList();
        }

        if (!$this->id) {
            $title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
at TYPO3\CMS\Backend\Controller\RecordListController->mainAction()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/Http/RouteDispatcher.php line 81
        $targetIdentifier = $route->getOption('target');
        $target = $this->getCallableFromTarget($targetIdentifier);
        $arguments = [$request];
        try {
            return $target(...$arguments);
        } catch (MethodNotAllowedException $exception) {
            return $exception->createResponse();
        }
    }
at TYPO3\CMS\Backend\Http\RouteDispatcher->dispatch()
in /var/www/html/TYPO3.CMS/typo3/sysext/backend/Classes/Http/RequestHandler.php line 104
        // there are Core classes that need the Request object but do not get it handed in
        $this->resetGlobalsToCurrentRequest($request);
        try {
            // Check if the router has the available route and dispatch.
            return $this->dispatcher->dispatch($request);
        } catch (MissingRequestTokenException $e) {
            // When token was missing, then redirect to login, but keep the current route as redirect after login
            $loginUrl = $this->uriBuilder->buildUriWithRedirect(
                'login',


Files

list-pid0-exception.png (3.12 MB) list-pid0-exception.png Benjamin Franzke, 2025-05-30 08:40

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #106722: Use Schema API in many EXT:core changesResolvedBenni Mack2025-05-16

Actions
Is duplicate of TYPO3 Core - Bug #106773: Use correct translation language capability field in route mapperResolvedOliver Bartsch2025-05-26

Actions
Actions #1

Updated by Benjamin Franzke 23 days ago

  • Related to Task #106722: Use Schema API in many EXT:core changes added
Actions #2

Updated by Benjamin Franzke 23 days ago

  • Is duplicate of Bug #106773: Use correct translation language capability field in route mapper added
Actions #3

Updated by Benjamin Franzke 23 days ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF