Skip to content
Snippets Groups Projects
Commit b4858c78 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #1598924 by david_garcia, omegamonk: Query with duplicate placeholders throws PDO Exception

parent 40d6efef
No related branches found
No related tags found
No related merge requests found
......@@ -133,11 +133,12 @@ public function preRender(&$values) {
if ($nids) {
$result = $this->database->query("SELECT n.nid, COUNT(c.cid) as num_comments FROM {node} n INNER JOIN {comment_field_data} c ON n.nid = c.entity_id AND c.entity_type = 'node' AND c.default_langcode = 1
LEFT JOIN {history} h ON h.nid = n.nid AND h.uid = :h_uid WHERE n.nid IN ( :nids[] )
AND c.changed > GREATEST(COALESCE(h.timestamp, :timestamp), :timestamp) AND c.status = :status GROUP BY n.nid", array(
AND c.changed > GREATEST(COALESCE(h.timestamp, :timestamp1), :timestamp2) AND c.status = :status GROUP BY n.nid", array(
':status' => CommentInterface::PUBLISHED,
':h_uid' => $user->id(),
':nids[]' => $nids,
':timestamp' => HISTORY_READ_LIMIT,
':timestamp1' => HISTORY_READ_LIMIT,
':timestamp2' => HISTORY_READ_LIMIT,
));
foreach ($result as $node) {
foreach ($ids[$node->id()] as $id) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment