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.
Comment | File | Size | Author |
---|---|---|---|
#2 | 1065968.patch | 726 bytes | droplet |
Comments
Comment #1
BerdirSounds correct, can you please create a patch?
See http://drupal.org/patch/create
Comment #2
droplet CreditAttribution: droplet commentedfirst patch after git migration :)
Comment #3
moshe weitzman CreditAttribution: moshe weitzman commentedComment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.