Closed itx-stefanie-doell closed 1 year ago
You need to rebuild the autoload of the system, after that the cache should work. There are configurations in the Services.yaml that need to be loaded.
I already rebuild the autoload system, but I think that does not change that I don't have the Frontend variable present for injection in the backend, or is this a misunderstanding?
If you take a close look you'll see that it asks for TYPO3\CMS\Core\Cache\Frontend\Frontend which is a core class.
A cache consists of a backend and a frontend. The backend accesses the database or the file system and the frontend provides the api to access the cache.
Cache\Frontend\Frontend has nothing to do with the website frontend.
Hi, first of all - thanks a lot for your extension, we use it several years now. Right now I'm working on an update to TYPO3 11 (PHP 8.1) - in my project I wrote a custom import, which uses the GeocodeService to calculate the long&lat for importet stores. Because of the update I changed my code to include the geocodeService via dependency injection. This results in the following error: Class "TYPO3\CMS\Core\Cache\Frontend\Frontend" does not exist. Reflection failed. caused by the dependency injections of the coordinatesCache class.
My suggestion for a solution would be:
public function __construct( FrontendUserAuthentication $frontendUser = null ) { /** @var \TYPO3\CMS\Core\Cache\CacheManager $cacheManager */ $cacheManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Cache\CacheManager::class ); $this->cacheFrontend = $cacheManager->getCache('store_finder_coordinate'); $this->frontendUser = $frontendUser; }
And afterwards use $this->cacheFrontend in the getInstance() Function as well.
For now I will overwrite the Coordinates Cache class, but I would be really happy to know If you have other suggestions to solve this problem.
Thanks a lot!