Download & Extend

Missing table prefix on query in node_feed()

Project:Drupal core
Version:8.x-dev
Component:node system
Category:task
Priority:minor
Assigned:Unassigned
Status:closed (fixed)
Issue tags:Novice, Quick fix

Issue Summary

The second condition of the query in node_feed() should have a table prefix, to make it like the other parts of the query. The current query is:

<?php
    $nids
= db_select('node', 'n')
      ->
fields('n', array('nid', 'created'))
      ->
condition('n.promote', 1)
      ->
condition('status', 1)
      ->
orderBy('n.created', 'DESC')
      ->
range(0, variable_get('feed_default_items', 10))
      ->
addTag('node_access')
      ->
execute()
      ->
fetchCol();
?>

To make the query look more uniform it should instead be:
<?php
    $nids
= db_select('node', 'n')
      ->
fields('n', array('nid', 'created'))
      ->
condition('n.promote', 1)
      ->
condition('n.status', 1)
      ->
orderBy('n.created', 'DESC')
      ->
range(0, variable_get('feed_default_items', 10))
      ->
addTag('node_access')
      ->
execute()
      ->
fetchCol();
?>

Comments

#1

Priority:normal» minor

I tagged this as Novice as it's a teeny-tiny thing that someone might like to do :)

#2

Issue tags:+Quick fix

I tagged Quick fix and wait for 2 weeks. If no one interested I will do.

#3

Status:active» needs review

Here's a patch!

AttachmentSizeStatusTest resultOperations
table-prefix-1279888-3.patch545 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 32,955 pass(es).View details

#4

Status:needs review» reviewed & tested by the community

#5

Status:reviewed & tested by the community» fixed

Committed to 7.x and 8.x.

#6

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.