#606516: View own unpublished content and respect module_grants added some logic into view_unpublished.module that attempts to preserve any changes (by other modules) to the 'access callback' item for node/%node menu items. This was done to accomodate module_grants.module.
The change introduced a problem, as it assumes that the updated access callback only expects 2 arguments:
return $old_access_callback('view', $node);
Some modules, such as Spaces, implement an access callback for nodes that expect more than 2 access arguments. ie:
[access callback] => spaces_menu_access
[access arguments] => Array
(
[0] => view
[1] => 1
[2] => node_access
)
Any additional access arguments should be passed along to the access callback, otherwise access denied errors can result.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1180572-6-proper-node-access-arguments.patch | 660 bytes | hanoii |
#5 | 1180572-5-proper-node-access-arguments.patch | 660 bytes | hanoii |
#1 | view_unpublished_pass_access_args-1180572-1.patch | 1.59 KB | ryan_courtnage |
Comments
Comment #1
ryan_courtnage CreditAttribution: ryan_courtnage commentedThe attached patch ensures that access arguments are passed appropriately.
Comment #2
smokrisSounds reasonable, and works for me. (Note that you need to clear cache after applying this patch.)
Can we get this patch committed?
Comment #3
pebosi CreditAttribution: pebosi commentedPatch works for me too. Please commit.
Comment #4
entendu CreditAttribution: entendu commentedCommitted to 6.x-dev branch
Comment #5
hanoiiThere's a small bug on this patch which is what happens if the node argument is not expected in the second position (index 1) node access callback?
Attached is a patch that rather search for the proper element in which to put to the node object
Comment #6
hanoiiSorry, one fix on my previous patch.
Comment #7
entendu CreditAttribution: entendu commentedMakes sense. Committing to dev.
Comment #8
entendu CreditAttribution: entendu commented