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.
This commit is contained in:
Daniel Siepmann 2021-06-14 16:06:26 +02:00
parent 1929a4a566
commit 5440ef4f72
2 changed files with 5 additions and 1 deletions

View file

@ -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');
}
/**

View file

@ -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',