From 5440ef4f727212900825a0d817c1fcfbac78dd95 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Mon, 14 Jun 2021 16:06:26 +0200 Subject: [PATCH] Fix not available cache for events_category Adjust cache name to match TYPO3 v10 convention without "cache_" prefix. Add default configuration to prevent issue if integrator does not configure cache. --- Classes/Service/CategoryService.php | 2 +- ext_localconf.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Classes/Service/CategoryService.php b/Classes/Service/CategoryService.php index d11aa32..a7b1637 100755 --- a/Classes/Service/CategoryService.php +++ b/Classes/Service/CategoryService.php @@ -21,7 +21,7 @@ class CategoryService public function __construct() { $this->timeTracker = GeneralUtility::makeInstance(TimeTracker::class); - $this->cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('cache_Events_category'); + $this->cache = GeneralUtility::makeInstance(CacheManager::class)->getCache('events_category'); } /** diff --git a/ext_localconf.php b/ext_localconf.php index 6899368..1b12074 100644 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -32,6 +32,10 @@ call_user_func( [\Wrm\Events\Controller\EventController::class => 'list'] ); + if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category'])) { + $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['events_category'] = []; + } + $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class); $iconRegistry->registerIcon( 'events-plugin',