Project

General

Profile

Actions

Bug #38838

closed

False PageCacheTimeout / getFirstTimeValueForRecord calculation with start-/stoptimes on multiple content elements.

Added by Alexander Opitz over 11 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
Caching
Target version:
Start date:
2012-07-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

If you have 2 content elements with start-/stoptimes in the feature getFirstTimeValueForRecord returns false values.

Setup:

- A page with two content elements.
- first content element has a starttime but no endtime
- second content element has a endtime but no starttime

MySQL Statement issued:

SELECT MIN AS starttime, MIN AS endtime
FROM tt_content
WHERE pid =19325
AND (
starttime >1341908220
OR endtime >1341908220
)
AND tt_content.deleted =0
AND tt_content.t3ver_state <=0
AND tt_content.pid <> -1
AND tt_content.hidden =0
AND (
tt_content.fe_group = ''
OR tt_content.fe_group IS NULL
OR tt_content.fe_group = '0'
OR FIND_IN_SET( '0', tt_content.fe_group )
OR FIND_IN_SET( '-1', tt_content.fe_group )
)
... (simplified)

The where statement now selects 2 content elements.
- first
-- starttime: value in future
-- endtime: 0
- second
-- starttime: 0
-- endtime: value in future

The min function for starttime and endtime results in
- starttime: 0
- endtime: 0

The later if statement validates if this values are greater then $now and so getFirstTimeValueForRecord returns PHP_INT_MAX

Fix:

The min select statement should be:

SELECT MIN ) AS starttime, MIN ) AS endtime

so the 0 values won't be respected.


Files

a.diff (1.16 KB) a.diff Alexander Opitz, 2012-07-10 11:05

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #35684: Cache duration wrongly calculated with associated recordsClosedFrancois Suter2012-04-04

Actions
Actions

Also available in: Atom PDF