Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class "Cobweb\ExternalImport\Utility\CompatibilityUtility" not found #295

Open
agriaIT opened this issue Sep 4, 2023 · 5 comments
Open

Comments

@agriaIT
Copy link

agriaIT commented Sep 4, 2023

Typo3 12.4.5
PHP 8.2.4
external_import 7.1.0
svconnector 5.1.0 is installed
svconnector_sql 4.1.0 is installed

After installing the extenstion via extension manager I get the following error in backend and frontend:

(1/1) Error
Class "Cobweb\ExternalImport\Utility\CompatibilityUtility" not found

in C:\xampp824\htdocs\typo312\typo3conf\ext\external_import\Configuration\TCA\Overrides\sys_reaction.php line 7
use Cobweb\ExternalImport\Reaction\ImportReaction;
use Cobweb\ExternalImport\Utility\CompatibilityUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

if (CompatibilityUtility::isV12()) {
ExtensionManagementUtility::addTcaSelectItem(
'sys_reaction',
'reaction_type',
[
at require()
in C:\xampp824\htdocs\typo312\typo3_src-12.4.5\typo3\sysext\core\Classes\Utility\ExtensionManagementUtility.php line 1457

    // To require TCA Overrides in a safe scoped environment avoiding local variable clashes.
    // @see TYPO3\CMS\Core\Tests\Functional\Utility\ExtensionManagementUtility\ExtensionManagementUtilityTcaOverrideRequireTest
    $scopedRequire = static function (string $filename): void {
        require $filename;
    };
    // Execute override files from Configuration/TCA/Overrides
    foreach ($activePackages as $package) {
        try {

at TYPO3\CMS\Core\Utility\ExtensionManagementUtility::TYPO3\CMS\Core\Utility{closure}('C:/xampp824/htdocs/typo312/typo3conf/ext/external_import/Configuration/TCA/Overrides\sys_reaction.php')
in C:\xampp824\htdocs\typo312\typo3_src-12.4.5\typo3\sysext\core\Classes\Utility\ExtensionManagementUtility.php line 1468
// No such directory in this package
continue;
}
foreach ($finder as $fileInfo) {
$scopedRequire($fileInfo->getPathname());
}
}

    // Call the TcaMigration and log any deprecations.

at TYPO3\CMS\Core\Utility\ExtensionManagementUtility::buildBaseTcaFromSingleFiles()
in C:\xampp824\htdocs\typo312\typo3_src-12.4.5\typo3\sysext\core\Classes\Utility\ExtensionManagementUtility.php line 1399
$cacheData = $codeCache->require($cacheIdentifier);
if ($cacheData) {
$GLOBALS['TCA'] = $cacheData['tca'];
} else {
static::buildBaseTcaFromSingleFiles();
static::createBaseTcaCacheFile($codeCache);
}
} else {
static::buildBaseTcaFromSingleFiles();
at TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadBaseTca(true, object(TYPO3\CMS\Core\Cache\Frontend\PhpFrontend))
in C:\xampp824\htdocs\typo312\typo3_src-12.4.5\typo3\sysext\core\Classes\Core\Bootstrap.php line 498
{
if ($allowCaching) {
$coreCache = $coreCache ?? GeneralUtility::makeInstance(CacheManager::class)->getCache('core');
}
ExtensionManagementUtility::loadBaseTca($allowCaching, $coreCache);
}

/**
 * Check if a configuration key has been configured

at TYPO3\CMS\Core\Core\Bootstrap::loadBaseTca(true, object(TYPO3\CMS\Core\Cache\Frontend\PhpFrontend))
in C:\xampp824\htdocs\typo312\typo3_src-12.4.5\typo3\sysext\core\Classes\Core\Bootstrap.php line 151
$eventDispatcher = $container->get(EventDispatcherInterface::class);
ExtensionManagementUtility::setEventDispatcher($eventDispatcher);
static::loadTypo3LoadedExtAndExtLocalconf(true, $coreCache);
static::unsetReservedGlobalVariables();
static::loadBaseTca(true, $coreCache);
static::checkEncryptionKey();
$bootState->complete = true;
$eventDispatcher->dispatch(new BootCompletedEvent($disableCaching));

at TYPO3\CMS\Core\Core\Bootstrap::init(object(Composer\Autoload\ClassLoader))
in C:\xampp824\htdocs\typo312\typo3_src-12.4.5\typo3\index.php line 20
// Set up the application for the backend
call_user_func(static function () {
$classLoader = require dirname(DIR).'/vendor/autoload.php';
\TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});
at {closure}()
in C:\xampp824\htdocs\typo312\typo3_src-12.4.5\typo3\index.php line 21
call_user_func(static function () {
$classLoader = require dirname(DIR).'/vendor/autoload.php';
\TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(1, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_BE);
\TYPO3\CMS\Core\Core\Bootstrap::init($classLoader)->get(\TYPO3\CMS\Backend\Http\Application::class)->run();
});

@fsuter
Copy link
Contributor

fsuter commented Sep 4, 2023

Hi. This could be an autoloading issue. I haven't worked with non-composer installation in ages, I don't remember how we used to regenerate the autoloading information.

Or could it be an issue with namespaces? Not ok to have use statements in TCA overrides in non-composer installations? Can you try by using the fully-qualified names and removing the use statements?

I hope this helps a bit.

@agriaIT
Copy link
Author

agriaIT commented Sep 5, 2023

Hi, sorry, I don't know what you mean. I'm not a typo3-developer. Can you fix that please?

@fsuter
Copy link
Contributor

fsuter commented Sep 6, 2023

I can try to take a look at some point, although I have no non-composer installation anywhere.

@fsuter
Copy link
Contributor

fsuter commented May 23, 2024

Usage of the compatibility utility class has been replaced in 9001d5e

I will soon release a new minor version. I'll keep you posted and you can test whether this still happens or not.

@fsuter
Copy link
Contributor

fsuter commented May 24, 2024

Please check if this is resolved installing new version 7.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants