Issue Bug Closed

#109509Allow using records from root page (pid 0) for calculating cache lifetime with config.cache

Tobias Kapplmüller 04/08/26, 09:17 updated 04/21/26, 11:30

Description

As stated in the title, trying to use records stored on the root page for cache lifetime calculation results in an error.

In my case, i want to use the start and end date set when editing file metadata:
@config.cache.all = sys_file_metadata:0@

However, the following exception is thrown instead:
@Unexpected value for parameter $tableDef. Expected <tablename>:<pid>…@</pid></tablename>

The reason for that seems to be that when parsing the table definition for config.cache (TYPO3\CMS\Frontend\Cache\CacheLifetimeCalculator::getFirstTimeValueForRecord), the pid is validated with empty() which considers an integer with value zero as empty:

if (empty($tableName) || empty($pid)) {
    throw new \InvalidArgumentException('Unexpected value for parameter $tableDef. Expected <tablename>:<pid>, got \'' . htmlspecialchars($tableDef) . '\'.', 1307190365);
}

I originally encountered this issue with TYPO3 v12.4.41 – however, above code snippet is identical for v13 and v14.

Reviews 2

History 26

  1. Gerrit Code Review pushed patch set 1 for main to change 93592 status New Under Review 04/09/26, 06:42

  2. Gerrit Code Review pushed patch set 2 for main to change 93592 04/09/26, 09:52

  3. Gerrit Code Review pushed patch set 1 for 13.4 to change 93602 04/09/26, 14:42

  4. Gerrit Code Review pushed patch set 2 for 13.4 to change 93602 04/09/26, 15:24

  5. Ravi Sachaniya commented and changed status Under Review Resolved done 0 % 100 % 04/09/26, 15:35

    Applied in changeset commit:6f4269dddb084ae58c83faadb50dfa0b2c0d3780.

  6. Benni Mack changed status Resolved Closed 04/21/26, 11:30