#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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ryan_courtnage’s picture

Status: Active » Needs review
FileSize
1.59 KB

The attached patch ensures that access arguments are passed appropriately.

smokris’s picture

Status: Needs review » Reviewed & tested by the community

Sounds reasonable, and works for me. (Note that you need to clear cache after applying this patch.)

Can we get this patch committed?

pebosi’s picture

Patch works for me too. Please commit.

entendu’s picture

Status: Reviewed & tested by the community » Closed (fixed)

Committed to 6.x-dev branch

hanoii’s picture

Status: Closed (fixed) » Needs review
FileSize
660 bytes

There'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

hanoii’s picture

Sorry, one fix on my previous patch.

entendu’s picture

Makes sense. Committing to dev.

entendu’s picture

Status: Needs review » Closed (fixed)