Issue Bug Closed

#69875custom named enablecolumns for starttime and enttime don't work

Philipp Schlosser 09/16/15, 12:59 updated 10/02/18, 11:34

Description

In TypoScriptFrontendController:

The function getFirstTimeValueForRecord() builds a query like this:
SELECT MIN (’ . $timeField . ‘) AS ‘ . $field …

- $field is either ‘starttime’ or ‘endtime’
- $timeField are the names of the model’s enablecolumns

Later we try to get the $result by checking $row[$timeField]

So if there are custom names for the enablecolumns, for example ‘visible_from’ and ‘visible_to’, the $row[$timeField] is empty all the time.
Because of the ‘AS’ statement we could only access the array $row by the key ‘starttime’ or ‘endtime’, but with $row[$timeField] we try to access $row by the key ‘visible_from’ or ‘visible_to’.

This issue could be fixed by changing $row[$timeField] to $row[$field].

Reviews 2