In function node_get_recent in node.module file you make this query :
$nids = $query
->fields('n', array('nid'))
->orderBy('changed', 'DESC')
->range(0, $number)
->addTag('node_access')
->execute()
->fetchCol();
The only problem here is that changed column is too ambitious when you alter the query via hook_query_node_access_alter.
The correct code should be :
$nids = $query
->fields('n', array('nid'))
->orderBy('n.changed', 'DESC')
->range(0, $number)
->addTag('node_access')
->execute()
->fetchCol();
This should be here because this function is the one that knows the alias and knows changed column to which table alias belongs and therefor should be added here.

CommentFileSizeAuthor
#2 1065968.patch726 bytesdroplet
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Sounds correct, can you please create a patch?

See http://drupal.org/patch/create

droplet’s picture

Version: 7.0 » 7.x-dev
Status: Active » Needs review
Issue tags: +Quick fix
FileSize
726 bytes

first patch after git migration :)

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community
Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

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