Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
$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:
$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();
Comment | File | Size | Author |
---|---|---|---|
#3 | table-prefix-1279888-3.patch | 545 bytes | davisben |
Comments
Comment #1
DamienMcKennaI tagged this as Novice as it's a teeny-tiny thing that someone might like to do :)
Comment #2
droplet CreditAttribution: droplet commentedI tagged Quick fix and wait for 2 weeks. If no one interested I will do.
Comment #3
davisbenHere's a patch!
Comment #4
droplet CreditAttribution: droplet commentedComment #5
Dries CreditAttribution: Dries commentedCommitted to 7.x and 8.x.