#109509Allow using records from root page (pid 0) for calculating cache lifetime with config.cache
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
-
Gerrit Code Review pushed patch set 1 for main to change 93592 status
NewUnder Review <span data-processor="relativetime" data-value="2026-04-09T06:42:09+00:00" > 04/09/26, 06:42 </span> -
Gerrit Code Review pushed patch set 2 for main to change 93592 <span data-processor="relativetime" data-value="2026-04-09T09:52:11+00:00" > 04/09/26, 09:52 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 93602 <span data-processor="relativetime" data-value="2026-04-09T14:42:00+00:00" > 04/09/26, 14:42 </span>
-
Gerrit Code Review pushed patch set 2 for 13.4 to change 93602 <span data-processor="relativetime" data-value="2026-04-09T15:24:28+00:00" > 04/09/26, 15:24 </span>
-
Ravi Sachaniya commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-04-09T15:35:09+00:00" > 04/09/26, 15:35 </span> -
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-04-21T11:30:35+00:00" > 04/21/26, 11:30 </span>
Applied in changeset commit:6f4269dddb084ae58c83faadb50dfa0b2c0d3780.