mindshape-GmbH / mindshape_cookie_consent

This extension provides functionality to create a customizable cookie consent for your website. It is developed for flexibility to be customized in accordance to your data security guidelines.
10 stars 13 forks source link

Installation breaks Typo3 Backend & Frontend #27

Closed martineisenberg closed 2 years ago

martineisenberg commented 2 years ago

During installation of the extension, the typo3 (v10.4.21) installation breaks. Both frontend and backend are not accessible anymore and yield a 500 Internal Server Error. In my logs I find the following:

"PHP Fatal error: Uncaught LogicException: TYPO3\CMS\Core\Cache\CacheManager can not be injected/instantiated during ext_localconf.php loading. Use lazy loading instead. in /data/www/XXX.at/typo3_src-10.4.21/typo3/sysext/core/Classes/ServiceProvider.php:97 Stack trace:

25 /data/www/XXX.at/httpdocs/typo3temp/var/cache/code/di/DependencyInjectionContainer_93869b03c4340f3e471a4b1ff32c6a92846b15aa.php(5197): TYPO3\CMS\Core\ServiceProvider::getCacheManager()

1 /data/www/XXX.at/typo3_src-10.4.21/vendor/symfony/dependency-injection/Container.php(248): DependencyInjectionContainer_93869b03c4340f3e471a4b1ff32c6a92846b15aa->getCacheManagerService()

2 /data/www/XXX.at/typo3_src-10.4.21/vendor/symfony/dependency-injection/Container.php(228): Symfony\Component\DependencyInjection\Container->make()

3 /data/www/XXX.at/typo3_src-10.4.21/typo3/sysext/core/Classes/ServiceProvider.php(210): Symfony\Component\DependencyInjection\Container->get()

4 /data/www/XXX.at/httpdoc in /data/www/XXX.at/typo3_src-10.4.21/typo3/sysext/core/Classes/ServiceProvider.php on line 97

I have not found anything on this matter so far so I assume it is related to my typo3 setup and the installed extensions more than a bug in your extension. However, the cache related error made sense to me as it is used in hooks in the ext_localconf.php which is somewhat stated in the error message, so I thought I would raise this here. Any idea on why this is happening for me?

featdd commented 2 years ago

Hi @meisenberg2305,

are you shure this is related to this extension? The only place the cache manager is instanciated is in a TCA hook, but via GeneralUtility and not Symfony Service.yaml.

Can you reproduce this error in a naked TYPO3 and tell me the steps you made!? Otherwise I would assume, by the stack trace you send, that the error is not related to the extensions itself but maybe in conflict with some other things in your instance.

I'll appreciate your feedback.

Greetings Daniel

martineisenberg commented 2 years ago

Hi,

on a clean installation of 10.4.21 (non-composer) upon installing v2.1.1 I get the following excerpt:

(1/1) Error Call to undefined method Doctrine\DBAL\Driver\Mysqli\MysqliStatement::fetchOne()

in C:\Xampp_7\htdocs\typo3_10.4.21\typo3conf\ext\mindshape_cookie_consent\Classes\Service\ExtensionDefaultDataService.php line 69 $resultCount = $queryBuilder ->count('*') ->from(Configuration::TABLE) ->execute() ->fetchOne();

        if (0 === $resultCount) {
            $this->addDefaultConfigurations();
        }

at Mindshape\MindshapeCookieConsent\Service\ExtensionDefaultDataService->checkAndAddDefaultConfigurations() in C:\Xampp_7\htdocs\typo3_10.4.21\typo3conf\ext\mindshape_cookie_consent\Classes\EventListener\AfterPackageActivationEventListener.php line 32 */ public function __invoke(AfterPackageActivationEvent $afterPackageActivationEvent) { if (SettingsUtility::EXTENSION_KEY === $afterPackageActivationEvent->getPackageKey()) { $this->extensionDefaultDataService->checkAndAddDefaultConfigurations(); } } } at Mindshape\MindshapeCookieConsent\EventListener\AfterPackageActivationEventListener->__invoke(object(TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent)) in C:\Xampp_7\htdocs\typo3_10.4.21\typo3\sysext\core\Classes\EventDispatcher\EventDispatcher.php line 51 if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { return $event; } foreach ($this->listenerProvider->getListenersForEvent($event) as $listener) { $listener($event); if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { break; } }

This may be related to a core bug maybe though for 10.4.21 as the dbal doctrine packages should be available by default within the core I assume?

featdd commented 2 years ago

Hi @meisenberg2305,

I tried both latest TYPO3 versions (11.5.5 & 10.4.23) and had no such issues. Please Update your TYPO3 instance and test this case again, but for now I will close this issue due to unreproducability.

Greetings Daniel