og_moderation module invokes clone_access_alter and causes permission issues for node_clone.
The clone page access argument function clone_access_cloning uses the $access boolean variable to determine access to cloning node.
It invokes an alter hook: drupal_alter("clone_access", $access, $node);
OG Moderation hooks into this and returns node access variables:
NODE_ACCESS_ALLOW ('allow')
NODE_ACCESS_DENY ('deny')
NODE_ACCESS_IGNORE (NULL)
These are not boolean values, in fact, NODE_ACCESS_IGNORE would return false for access when it should be allowing access.
The patch below detaches the $access boolean with the results of drupal_alter. However, now if a module doesn't use NODE_ACCESS_... variables it will not work properly. I'm not sure if this is a node_clone issue or og_moderation, what's the general practice for this?
Comment | File | Size | Author |
---|---|---|---|
#2 | overwrites_clone_access-2368293-2.patch | 1.08 KB | jastraat |
node_clone_accessfix.patch | 1.1 KB | Siavash |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedThis looks like a bug in og_moderation
Comment #2
jastraat CreditAttribution: jastraat at Technivant commentedBy setting $data to NODE_ACCESS_IGNORE by default, og_moderation is overwriting the $access value even it it isn't providing access. If another module is also implementing hook_clone_access_alter(), og_moderation completely overwrites any access grants by modules that fired before it.
Attached is a patch that only changes the access value if og_moderation is granting access.
Comment #3
jastraat CreditAttribution: jastraat at Technivant commentedUpdating credit.
Comment #4
jastraat CreditAttribution: jastraat at Technivant commentedUpdating status.
Comment #5
jastraat CreditAttribution: jastraat at Technivant commentedAlso - you may want to update either the branch recommended in version control information or merge the changes from 7.x-2.x into master. Right now it's quite confusing.
Comment #6
TunprogI've found the same bug, patch #2 fixes the problem.
Comment #8
shenzhuxi CreditAttribution: shenzhuxi commented