Needs review
Project:
Views Ignore Node Permissions
Version:
6.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Aug 2010 at 21:56 UTC
Updated:
2 Mar 2012 at 07:42 UTC
Jump to comment: Most recent file
Comments
Comment #1
crystaldawn commentedYea I just discovered this one myself. It's going to require a patch to the views.inc file in order to fix it. Ideally I'd like to propose a new hook to the views project that allows modules to modify the pager query but I dont think that such a request would be accepted since it's a 'new feature' and drupal projects for some reason are afraid of 'new features' and would rather live with buggy things than with things that actually function properly. So for now here is how I fixed it for my own site:
To get the pager to show up for users that do not have access to the "administer nodes" rule, you need to modify the view.inc file on line 702
Line 702 starts with $count_query = db_rewrite_sql($this->build_info['count_query'], $this->base_table, $this->base_field, array('view' => &$this));
Simply add this right after line 702 in views/includes/view.inc
if (is_object($this->display[$this->current_display]->handler->handlers['filter']['ignore_node_permissions']))
{
$count_query = $this->build_info['count_query'];
}
This will fix users not being able to see the pager.
Comment #2
seehawk commentedHaving the same issue.
Being able to bypass node permissions has been on the Views team's radar for at least a year:
http://drupal.org/node/548104
http://drupal.org/node/621142
So they might be receptive to a patch. Could be worth a try.
Comment #3
gooddesignusa commentedDarn this is a deal breaker for me :(
Keeping an eye on this issue.
Comment #4
David_Rothstein commentedIt shouldn't be necessary to hack Views to fix this issue. Can't we just fix it in this module?
The attached patch seems like it should work... I've tested it lightly combined with Views 6.x-2.16 and haven't seen any problems so far.
Comment #5
othermachines commentedThanks, David. Works great for me.
Do we care to support versions < 6.x-2.14?
(Snippet ganked from Views Bulk Operations' views_bulk_operations_pager_helper class.)
Comment #6
oskar_calvo commentedshould be great a new version with the patch.
thanks
Oskar
Comment #7
othermachines commentedIt's been a few weeks so I'm adding a revised patch that takes versions < 6.x-2.14 into account. Care to test, anyone?
Comment #8
oskar_calvo commentedI wll test it.
Thanks
Oskar