Unverified Commit 07dd3e2c authored by alexpott's avatar alexpott
Browse files

Issue #3128761 by Beakerboy, daffie, alexpott, xjm: Duplicate timestamp...

Issue #3128761 by Beakerboy, daffie, alexpott, xjm: Duplicate timestamp placeholder in statistics query
parent 4569c101
......@@ -96,7 +96,10 @@ public function import(Row $row, array $old_destination_id_values = []) {
])
->expression('daycount', 'daycount + :daycount', [':daycount' => $daycount])
->expression('totalcount', 'totalcount + :totalcount', [':totalcount' => $totalcount])
->expression('timestamp', 'CASE WHEN timestamp > :timestamp THEN timestamp ELSE :timestamp END', [':timestamp' => $timestamp])
// Per Drupal policy: "A query may have any number of placeholders, but
// all must have unique names even if they have the same value."
// https://www.drupal.org/docs/8/api/database-api/static-queries#placeholders
->expression('timestamp', 'CASE WHEN timestamp > :timestamp1 THEN timestamp ELSE :timestamp2 END', [':timestamp1' => $timestamp, ':timestamp2' => $timestamp])
->execute();
return [$row->getDestinationProperty('nid')];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment