Bug #91773

insufficient check in CacheManager::createAllCaches()

Added by David Bruchmann 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Caching
Start date:
2020-07-09
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Preface:
This bug occurs when using a proxy-class in context and as extension for georgringer/news.
The bug can be resolved by changing a single line.
The bug is also explained on https://github.com/georgringer/news/issues/1301.

Description:
Debugging the array TYPO3\CMS\Core\Cache\CacheManager->cacheConfigurations there is a sub-array without key, which drives the whole backend unusable if triggered:

$cacheConfigurations => array(17 items)
      core => array(4 items)
      hash => array(4 items)
      pages => array(4 items)
      pagesection => array(4 items)
      runtime => array(4 items)
      rootline => array(4 items)
      imagesizes => array(4 items)
      assets => array(4 items)
      l10n => array(4 items)
      fluid_template => array(3 items)
      extbase => array(4 items)
      adminpanel_requestcache => array(empty)
      rx_shariff => array(4 items)
      news => array(4 items)
      '' => array(1 item)
          groups => array(2 items)
             0 => 'pages' (5 chars)
             1 => 'all' (3 chars)
      static_info_tables => array(3 items)
      news_category => array(1 item)

In my case the sub-array includes useless and needless details and can be omitted completely.

Changing one line in CacheManager::createAllCaches() solves the issue in my case:

    if (!isset($this->caches[$identifier])) {
        $this->createCache($identifier);
    }

to this:
    if ($identifier && !isset($this->caches[$identifier])) {
        $this->createCache($identifier);
    }

The situation when the error is triggered is not completely clear for me but I remarked that after a composer-update it's showing up.
To get rid of the error it's required to remove Extension-Configuration manually from LocalConfiguration.php even after having deinstalled my extension and news, but this is neither suitable nor a reliable solution.


Related issues

Related to TYPO3 Core - Bug #91959: Adding a cache configuration with empty identifiers leads to later issuesClosedSimon Gilli2020-08-09

Actions

Also available in: Atom PDF