Bug #38838
closedFalse PageCacheTimeout / getFirstTimeValueForRecord calculation with start-/stoptimes on multiple content elements.
100%
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