Skip to content

Commit b2e7fb0

Browse files
Mabaheirnnr
authored andcommitted
[BUGFIX] Initializer creates wrong queue items with starttime in future
The field "changed" is wrong for records with starttime in future. This results in a exception on indexing such pages, because the record have to be indexed not until the starttime is past. Solution: use greatest value of starttime and tstamp on initializing the queue. Resolves: #57890 Releases: 3.0, 2.8 Change-Id: Idf687f8f69c5372e1a73c8a23439c7251bb64521
1 parent ce276c1 commit b2e7fb0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Classes/IndexQueue/Initializer/Abstract.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,17 @@ protected function logInitialization($initializationQuery) {
177177
*
178178
*/
179179
protected function buildSelectStatement() {
180+
$changedField = $GLOBALS['TCA'][$this->type]['ctrl']['tstamp'];
181+
if (!empty($GLOBALS['TCA'][$this->type]['ctrl']['enablecolumns']['starttime'])) {
182+
$changedField = 'GREATEST(' . $GLOBALS['TCA'][$this->type]['ctrl']['enablecolumns']['starttime'] . ',' . $GLOBALS['TCA'][$this->type]['ctrl']['tstamp'] . ')';
183+
}
180184
$select = 'SELECT '
181185
. '\'' . $this->site->getRootPageId() . '\' as root, '
182186
. '\'' . $this->type . '\' AS item_type, '
183187
. 'uid AS item_uid, '
184188
. '\'' . $this->indexingConfigurationName . '\' as indexing_configuration, '
185189
. $this->getIndexingPriority() . ' AS indexing_priority, '
186-
. $GLOBALS['TCA'][$this->type]['ctrl']['tstamp'] . ' AS changed';
190+
. $changedField . ' AS changed';
187191

188192
return $select;
189193
}

0 commit comments

Comments
 (0)