When viewing a node, if you don't have access to view revisions, _node_revision_access() should bail out early, instead that seems to be the last check. This results in a query on single node views for auth users which shouldn't be there.

http://api.drupal.org/api/function/_node_revision_access/7

Comments

catch’s picture

Title: _node_revision_access() issues unecessary query » _node_revision_access() issues unnecessary query
Status: Active » Needs review
StatusFileSize
new2.66 KB

Here's a patch.

catch’s picture

StatusFileSize
new2.66 KB

Code style horror, no other changes.

Status: Needs review » Needs work

The last submitted patch, node_revision_access.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new2.17 KB

Fix typo.

Status: Needs review » Needs work

The last submitted patch, node_revision_access.patch, failed testing.

catch’s picture

Status: Needs work » Needs review
StatusFileSize
new2.17 KB

This one passes.

moshe weitzman’s picture

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

Status: Reviewed & tested by the community » Fixed

Nice catch. Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Performance

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