lochmueller / autoloader

⚙️ Best TYPO3 Swiss Army knife ever ⚙️
http://typo3.org/extensions/repository/view/autoloader
20 stars 30 forks source link

TYPO3 v9.5: Install Tool: Check for broken extension on simple provider extension fails #138

Closed josefglatz closed 5 years ago

josefglatz commented 5 years ago

When running the "Check for broken extensions" check on a simple provider ext which does user the content element feature of the autoloader ext, the following exceptions are shown in the ajax request response. (If you need the provider extension, I can send you privately)

image


image image image image image

Whoops, looks like something went wrong.
Get help in the TYPO3 Wiki
If you need help solving this exception, you can have a look at the TYPO3 Wiki. There you can find solutions provided by the TYPO3 community. Once you have found a solution to the problem, help others by contributing to the wiki page.

Find a solution for this exception in the TYPO3 wiki.

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Invalid argument supplied for foreach() in /app/web/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 293

in /app/web/typo3/sysext/core/Classes/Error/ErrorHandler.php line 116
            E_DEPRECATED => 'PHP Runtime Deprecation Notice'
        ];
        $message = $errorLevels[$errorLevel] . ': ' . $errorMessage . ' in ' . $errorFile . ' line ' . $errorLine;
        if ($errorLevel & $this->exceptionalErrors) {
            throw new Exception($message, 1476107295);
        }
        switch ($errorLevel) {
            case E_USER_ERROR:
            case E_RECOVERABLE_ERROR:
at TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'Invalid argument supplied for foreach()', '/app/web/typo3/sysext/core/Classes/Utility/RootlineUtility.php', 293, array('uid' => 1, 'pageRecord' => array('pid' => 0, 'uid' => 1, 't3ver_oid' => 0, 't3ver_wsid' => 0, 't3ver_state' => 0, 'title' => 'Startseite', 'alias' => '', 'nav_title' => '', 'media' => 0, 'layout' => 0, 'hidden' => 0, 'starttime' => 0, 'endtime' => 0, 'fe_group' => '', 'extendToSubpages' => 0, 'doktype' => 1, 'TSconfig' => '', 'tsconfig_includes' => 'EXT:theme/Configuration/TSConfig/PageGeneral.tsc,EXT:ccontent/Configuration/TSConfig/Page/TSConfig.tsc', 'is_siteroot' => 1, 'mount_pid' => 0, 'mount_pid_ol' => 0, 'fe_login_mode' => 0, 'backend_layout_next_level' => 'pagets__Default', 'nav_hide' => 0, 'shortcut' => 0, 'shortcut_mode' => 0), 'connectionPool' => object(TYPO3\CMS\Core\Database\ConnectionPool)))
in /app/web/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 293
    {
        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);

        // @todo Remove this special interpretation of relations by consequently using RelationHandler
        foreach ($GLOBALS['TCA']['pages']['columns'] as $column => $configuration) {
            // Ensure that only fields defined in $rootlineFields (and "addRootLineFields") are actually evaluated
            if (array_key_exists($column, $pageRecord) && $this->columnHasRelationToResolve($configuration)) {
                $configuration = $configuration['config'];
                if ($configuration['MM']) {
at TYPO3\CMS\Core\Utility\RootlineUtility->enrichWithRelationFields(1, array('pid' => 0, 'uid' => 1, 't3ver_oid' => 0, 't3ver_wsid' => 0, 't3ver_state' => 0, 'title' => 'Startseite', 'alias' => '', 'nav_title' => '', 'media' => 0, 'layout' => 0, 'hidden' => 0, 'starttime' => 0, 'endtime' => 0, 'fe_group' => '', 'extendToSubpages' => 0, 'doktype' => 1, 'TSconfig' => '', 'tsconfig_includes' => 'EXT:theme/Configuration/TSConfig/PageGeneral.tsc,EXT:ccontent/Configuration/TSConfig/Page/TSConfig.tsc', 'is_siteroot' => 1, 'mount_pid' => 0, 'mount_pid_ol' => 0, 'fe_login_mode' => 0, 'backend_layout_next_level' => 'pagets__Default', 'nav_hide' => 0, 'shortcut' => 0, 'shortcut_mode' => 0))
in /app/web/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 270
            if (is_array($row)) {
                if ($this->languageUid > 0) {
                    $row = $this->pageContext->getPageOverlay($row, $this->languageUid);
                }
                $row = $this->enrichWithRelationFields($row['_PAGES_OVERLAY_UID'] ??  $uid, $row);
                self::$pageRecordCache[$currentCacheIdentifier] = $row;
            }
        }
        if (!is_array(self::$pageRecordCache[$currentCacheIdentifier])) {
at TYPO3\CMS\Core\Utility\RootlineUtility->getRecordArray(1)
in /app/web/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 396
     * @throws CircularRootLineException
     */
    protected function generateRootlineCache()
    {
        $page = $this->getRecordArray($this->pageUid);
        // If the current page is a mounted (according to the MP parameter) handle the mount-point
        if ($this->isMountedPage()) {
            $mountPoint = $this->getRecordArray($this->parsedMountPointParameters[$this->pageUid]);
            $page = $this->processMountedPage($page, $mountPoint);
at TYPO3\CMS\Core\Utility\RootlineUtility->generateRootlineCache()
in /app/web/typo3/sysext/core/Classes/Utility/RootlineUtility.php line 217
        }
        if (!isset(static::$localCache[$this->cacheIdentifier])) {
            $entry = static::$cache->get($this->cacheIdentifier);
            if (!$entry) {
                $this->generateRootlineCache();
            } else {
                static::$localCache[$this->cacheIdentifier] = $entry;
                $depth = count($entry);
                // Populate the root-lines for parent pages as well
at TYPO3\CMS\Core\Utility\RootlineUtility->get()
in /app/web/typo3/sysext/extbase/Classes/Configuration/BackendConfigurationManager.php line 66
            // Get the root line
            $rootline = [];
            if ($pageId > 0) {
                try {
                    $rootline = GeneralUtility::makeInstance(RootlineUtility::class, $pageId)->get();
                } catch (\RuntimeException $e) {
                    $rootline = [];
                }
            }
at TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager->getTypoScriptSetup()
in /app/web/typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php line 215
     * @return array
     */
    protected function getExtbaseConfiguration()
    {
        $setup = $this->getTypoScriptSetup();
        $extbaseConfiguration = [];
        if (isset($setup['config.']['tx_extbase.'])) {
            $extbaseConfiguration = $this->typoScriptService->convertTypoScriptArrayToPlainArray($setup['config.']['tx_extbase.']);
        }
at TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager->getExtbaseConfiguration()
in /app/web/typo3/sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php line 151
        $configurationCacheKey = strtolower(($extensionName ?: $this->extensionName) . '_' . ($pluginName ?: $this->pluginName));
        if (isset($this->configurationCache[$configurationCacheKey])) {
            return $this->configurationCache[$configurationCacheKey];
        }
        $frameworkConfiguration = $this->getExtbaseConfiguration();
        if (!isset($frameworkConfiguration['persistence']['storagePid'])) {
            $frameworkConfiguration['persistence']['storagePid'] = $this->getDefaultBackendStoragePid();
        }
        // only merge $this->configuration and override switchableControllerActions when retrieving configuration of the current plugin
at TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager->getConfiguration('ccontent', null)
in /app/web/typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php line 127
            case self::CONFIGURATION_TYPE_SETTINGS:
                $configuration = $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName);
                return $configuration['settings'] ?? [];
            case self::CONFIGURATION_TYPE_FRAMEWORK:
                return $this->concreteConfigurationManager->getConfiguration($extensionName, $pluginName);
            case self::CONFIGURATION_TYPE_FULL_TYPOSCRIPT:
                return $this->concreteConfigurationManager->getTypoScriptSetup();
            default:
                throw new \TYPO3\CMS\Extbase\Configuration\Exception\InvalidConfigurationTypeException('Invalid configuration type "' . $configurationType . '"', 1206031879);
at TYPO3\CMS\Extbase\Configuration\ConfigurationManager->getConfiguration('Framework', 'ccontent')
in /app/web/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php line 233
     */
    protected static function loadTypoScriptLabels($extensionName, $languageFilePath)
    {
        $configurationManager = static::getConfigurationManager();
        $frameworkConfiguration = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK, $extensionName);
        if (!is_array($frameworkConfiguration['_LOCAL_LANG'] ?? false)) {
            return;
        }
        self::$LOCAL_LANG_UNSET[$languageFilePath] = [];
at TYPO3\CMS\Extbase\Utility\LocalizationUtility::loadTypoScriptLabels('ccontent', 'EXT:ccontent/Resources/Private/Language/locallang.xlf')
in /app/web/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php line 165
                }
            }
        }
        if (!empty($extensionName)) {
            static::loadTypoScriptLabels($extensionName, $languageFilePath);
        }
    }

    /**
at TYPO3\CMS\Extbase\Utility\LocalizationUtility::initializeLocalization('EXT:ccontent/Resources/Private/Language/locallang.xlf', 'default', array(), 'ccontent')
in /app/web/typo3/sysext/extbase/Classes/Utility/LocalizationUtility.php line 96
        }
        if (empty($alternativeLanguageKeys)) {
            $alternativeLanguageKeys = $languageKeys['alternativeLanguageKeys'];
        }
        static::initializeLocalization($languageFilePath, $languageKey, $alternativeLanguageKeys, $extensionName);

        // The "from" charset of csConv() is only set for strings from TypoScript via _LOCAL_LANG
        if (!empty(self::$LOCAL_LANG[$languageFilePath][$languageKey][$key][0]['target'])
            || isset(self::$LOCAL_LANG_UNSET[$languageFilePath][$languageKey][$key])
at TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('content.element.deeplink_teaser', 'ccontent')
in /app/web/typo3conf/ext/autoloader/Classes/Utility/TranslateUtility.php line 121
    public static function getLll($key, $extensionKey, $tableName = null)
    {
        $file = self::getLllString($key, $extensionKey, null, $tableName);

        return LocalizationUtility::translate($file, $extensionKey);
    }

    /**
     * Check if table name file base is used.
at HDNET\Autoloader\Utility\TranslateUtility::getLll('content.element.deeplink_teaser', 'ccontent', 'tt_content')
in /app/web/typo3conf/ext/autoloader/Classes/Utility/TranslateUtility.php line 76

            $GLOBALS['LANG'] = GeneralUtility::makeInstance($version9orHigher ? \TYPO3\CMS\Core\Localization\LanguageService::class : LanguageService::class);
            $GLOBALS['LANG']->init($GLOBALS['BE_USER']->uc['lang']);
        }
        if (TYPO3_MODE === 'BE' && null === self::getLll($key, $extensionKey, $tableName)) {
            $lllString = self::getLll('pleaseSet', 'autoloader') . $lllString;
            if (isset($GLOBALS['LANG'])) {
                self::assureLabel($key, $extensionKey, $key, null, $tableName);
            }
at HDNET\Autoloader\Utility\TranslateUtility::getLllOrHelpMessage('content.element.deeplink_teaser', 'ccontent', 'tt_content')
in /app/web/typo3conf/ext/autoloader/Classes/Loader/ContentObjects.php line 151
            $typeKey = $loader->getExtensionKey() . '_' . $e;

            ExtensionManagementUtility::addPlugin([
                TranslateUtility::getLllOrHelpMessage('content.element.' . $e, $loader->getExtensionKey(),
                    'tt_content'),
                $typeKey,
                $config['iconExt'],
            ], 'CType', $loader->getExtensionKey());

at HDNET\Autoloader\Loader\ContentObjects->loadExtensionTables(object(HDNET\Autoloader\Loader), array('deeplink_teaser' => array('fieldConfiguration' => 'image,header,bodytext,header_link', 'richTextFields' => array('bodytext'), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\DeeplinkTeaser', 'model' => 'DeeplinkTeaser', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/DeeplinkTeaser.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/DeeplinkTeaser.svg', 'noHeader' => true, 'tabInformation' => 'homepage'), 'iframe' => array('fieldConfiguration' => 'iframe_html_link,iframe_height', 'richTextFields' => array(), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\Iframe', 'model' => 'Iframe', 'icon' => '/typo3conf/ext/autoloader/ext_icon.png', 'iconExt' => '/typo3conf/ext/autoloader/ext_icon.png', 'noHeader' => true, 'tabInformation' => 'special'), 'intro_teaser' => array('fieldConfiguration' => 'subheader,header,header_layout,bodytext,cta_button_label,cta_button_link,cta_link_label,cta_link_link', 'richTextFields' => array('bodytext'), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\IntroTeaser', 'model' => 'IntroTeaser', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/IntroTeaser.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/IntroTeaser.svg', 'noHeader' => true, 'tabInformation' => 'homepage'), 'login_teaser' => array('fieldConfiguration' => '', 'richTextFields' => array(), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\LoginTeaser', 'model' => 'LoginTeaser', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/LoginTeaser.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/LoginTeaser.svg', 'noHeader' => true, 'tabInformation' => 'common'), 'logo_grid' => array('fieldConfiguration' => 'image', 'richTextFields' => array(), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\LogoGrid', 'model' => 'LogoGrid', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/LogoGrid.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/LogoGrid.svg', 'noHeader' => false, 'tabInformation' => 'common'), 'logos' => array('fieldConfiguration' => 'image', 'richTextFields' => array(), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\Logos', 'model' => 'Logos', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/Logos.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/Logos.svg', 'noHeader' => true, 'tabInformation' => 'homepage'), 'membership_teaser' => array('fieldConfiguration' => 'image,header,header_link,bodytext', 'richTextFields' => array(), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\MembershipTeaser', 'model' => 'MembershipTeaser', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/MembershipTeaser.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/MembershipTeaser.svg', 'noHeader' => true, 'tabInformation' => 'homepage'), 'organization_facts' => array('fieldConfiguration' => 'bodytext', 'richTextFields' => array(), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\OrganizationFacts', 'model' => 'OrganizationFacts', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/OrganizationFacts.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/OrganizationFacts.svg', 'noHeader' => true, 'tabInformation' => 'homepage'), 'president_teaser' => array('fieldConfiguration' => 'subheader,header,bodytext,cta_button_label,cta_button_link,cta_link_label,cta_link_link,image', 'richTextFields' => array('bodytext'), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\PresidentTeaser', 'model' => 'PresidentTeaser', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/PresidentTeaser.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/PresidentTeaser.svg', 'noHeader' => true, 'tabInformation' => 'homepage'), 'sidebar_teaser' => array('fieldConfiguration' => 'image,header,header_layout,bodytext,cta_button_label,cta_button_link,cta_link_label,cta_link_link', 'richTextFields' => array('bodytext'), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\SidebarTeaser', 'model' => 'SidebarTeaser', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/SidebarTeaser.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/SidebarTeaser.svg', 'noHeader' => true, 'tabInformation' => 'sidebar'), 'testimonial' => array('fieldConfiguration' => 'bodytext,image,header,author_info,header_link', 'richTextFields' => array(), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\Testimonial', 'model' => 'Testimonial', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/Testimonial.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/Testimonial.svg', 'noHeader' => true, 'tabInformation' => 'homepage'), 'text_teaser' => array('fieldConfiguration' => 'bodytext', 'richTextFields' => array('bodytext'), 'modelClass' => 'SUP7\\Ccontent\\Domain\\Model\\Content\\TextTeaser', 'model' => 'TextTeaser', 'icon' => '/typo3conf/ext/ccontent/Resources/Public/Icons/Content/TextTeaser.svg', 'iconExt' => 'EXT:ccontent/Resources/Public/Icons/Content/TextTeaser.svg', 'noHeader' => false, 'tabInformation' => 'common')))
in /app/web/typo3conf/ext/autoloader/Classes/Loader.php line 191
        foreach ($autoLoaderObjects as $object) {
            /** @var LoaderInterface $object */
            $informationArray = $information[\get_class($object)];
            if (\is_array($informationArray)) {
                $object->loadExtensionTables($this, $informationArray);
            }
        }
    }

at HDNET\Autoloader\Loader->loadExtTables('SUP7', 'ccontent', array('ContentObjects', 'TcaFiles', 'SmartObjects'))
in /app/web/typo3conf/ext/autoloader/Classes/Loader.php line 124
    {
        self::allowNonDoctrineAnnotations();
        /** @var \HDNET\Autoloader\Loader $loader */
        $loader = GeneralUtility::makeInstance(self::class);
        $loader->loadExtTables($vendorName, $extensionKey, $implementations);
    }

    /**
     * Call this method in the ext_localconf.php file.
at HDNET\Autoloader\Loader::extTables('SUP7', 'ccontent', array('ContentObjects', 'TcaFiles', 'SmartObjects'))
in /app/web/typo3conf/ext/ccontent/ext_tables.php line 7
defined('TYPO3_MODE') || die('Access denied.');

// @TODO: TYPO3v9: ext:autoloader could make troubles with this TCA changes via ext_tables.php
\HDNET\Autoloader\Loader::extTables('SUP7', 'ccontent', array(
    'ContentObjects',
    'TcaFiles',
    'SmartObjects'
));
at require('/app/web/typo3conf/ext/ccontent/ext_tables.php')
in /app/web/typo3/sysext/install/Classes/Controller/UpgradeController.php line 1151
        if (@file_exists($extTablesPath)) {
            // $_EXTKEY and $_EXTCONF are available in ext_tables.php
            // and are explicitly set in cached file as well
            $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY] ?? null;
            require $extTablesPath;
        }
    }

    /**
at TYPO3\CMS\Install\Controller\UpgradeController->extensionCompatTesterLoadExtTablesForExtension(object(TYPO3\CMS\Core\Package\Package))
in /app/web/typo3/sysext/install/Classes/Controller/UpgradeController.php line 428
            // Load all ext_localconf files first
            $this->extensionCompatTesterLoadExtLocalconfForExtension($package);
        }
        foreach ($activePackages as $package) {
            $this->extensionCompatTesterLoadExtTablesForExtension($package);
            if ($package->getPackageKey() === $extension) {
                break;
            }
        }
at TYPO3\CMS\Install\Controller\UpgradeController->extensionCompatTesterLoadExtTablesAction(object(TYPO3\CMS\Core\Http\ServerRequest))
in /app/web/typo3/sysext/install/Classes/Http/RequestHandler.php line 205
                    'Unknown action method ' . $action . ' in controller ' . $controllerName,
                    1505216027
                );
            }
            $response = $controller->$action($request);
        }

        return $response;
    }
at TYPO3\CMS\Install\Http\RequestHandler->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /app/web/typo3/sysext/install/Classes/Http/Application.php line 65
    {
        $this->initializeContext();
        foreach ($this->availableRequestHandlers as $handler) {
            if ($handler->canHandleRequest($request)) {
                return $handler->handle($request);
            }
        }
        throw new \TYPO3\CMS\Core\Exception('No suitable request handler found.', 1518448686);
    }
at TYPO3\CMS\Install\Http\Application->handle(object(TYPO3\CMS\Core\Http\ServerRequest))
in /app/web/typo3/sysext/core/Classes/Http/AbstractApplication.php line 110
    final public function run(callable $execute = null)
    {
        try {
            $response = $this->handle(
                \TYPO3\CMS\Core\Http\ServerRequestFactory::fromGlobals()
            );
            if ($execute !== null) {
                call_user_func($execute);
            }
at TYPO3\CMS\Core\Http\AbstractApplication->run()
in /app/web/typo3/install.php line 104

call_user_func(function () {
    $classLoader = require dirname(dirname(__DIR__)).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_INSTALL);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, true)->get(\TYPO3\CMS\Install\Http\Application::class)->run();
});
at {closure}()
in /app/web/typo3/install.php line 105
call_user_func(function () {
    $classLoader = require dirname(dirname(__DIR__)).'/vendor/autoload.php';
    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_INSTALL);
    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, true)->get(\TYPO3\CMS\Install\Http\Application::class)->run();
});
lochmueller commented 5 years ago

Hey @josefglatz I test it in my Dev box. Also delete the labels (because you stacktrace create Labels), But I do not get the error. Is the error still valid? Regards, Tim

lochmueller commented 5 years ago

Hey @josefglatz I add a check to the function avoid calls in the translation workflow on install tool request. Thanks for the bugreport. Regards, Tim