lochmueller / autoloader

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

TYPO3 11 and PHP 8 - PHP Warning: Undefined array key "autoloader" #174

Closed dev-stefan closed 2 years ago

dev-stefan commented 2 years ago

When using the autoloader extension with PHP 8 I receive the following PHP Warning due to PHP strict mode. The error occurs while trying to load a backend layout. The TYPO3 instance cannot be used with having this issue.

(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception PHP Warning: Undefined array key "autoloader" in /var/www/html/public/typo3conf/ext/autoloader/Classes/Utility/TranslateUtility.php line 39

in /var/www/html/public/typo3/sysext/core/Classes/Error/ErrorHandler.php line 145 }

    $message = self::ERROR_LEVEL_LABELS[$errorLevel] . ': ' . $errorMessage . ' in ' . $errorFile . ' line ' . $errorLine;
    if ($errorLevel & $this->exceptionalErrors) {
        throw new Exception($message, 1476107295);
    }

    $message = $this->getFormattedLogMessage($message);

at TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'Undefined array key "autoloader"', '/var/www/html/public/typo3conf/ext/autoloader/Classes/Utility/TranslateUtility.php', 39) in /var/www/html/public/typo3conf/ext/autoloader/Classes/Utility/TranslateUtility.php line 39

at HDNET\Autoloader\Utility\TranslateUtility::assureLabel('backendLayout.Home.txt', 'website', 'Home') in /var/www/html/public/typo3conf/ext/autoloader/Classes/Loader/BackendLayout.php line 43 $extension = IconUtility::getIconFileExtension(GeneralUtility::getFileAbsFileName($iconPath));

        $translationKey = 'backendLayout.'.$pathInfo['basename'];
        if (LoaderInterface::EXT_TABLES === $type) {
            TranslateUtility::assureLabel($translationKey, $loader->getExtensionKey(), $pathInfo['filename']);
        }
        $backendLayouts[] = [
            'path' => 'EXT:'.$loader->getExtensionKey().'/Resources/Private/BackendLayouts/'.$file,
            'filename' => $pathInfo['filename'],
lochmueller commented 2 years ago

Thanks for reporting this warning. Fixed in current master.