Modules that wish to extend clone access with the clone_access_alter hook are not implemented due to the $access variable not being updated. The attached patch fixes this issue.

CommentFileSizeAuthor
clone_access-patch.txt464 bytesv1nce

Comments

pwolanin’s picture

Status: Needs review » Postponed (maintainer needs more info)

The function signature for _alter hooks is that the first param is passed by reference. Did you implement your hook as such?

v1nce’s picture

Status: Postponed (maintainer needs more info) » Needs review

Yes, but your code is not updating the $access variable within the clone_access() function. See the node.module example code:

<?php
foreach (module_implements('nodeapi') as $name) {
    $function = $name .'_nodeapi';
    $result = $function($node, $op, $a3, $a4);
?>

$result variable is updated with the return value from hook_nodeapi.

pwolanin’s picture

Status: Needs review » Closed (works as designed)

This is an _alter hook like hook_form_alter - there is not expected to be a return value. You need to declare the first parameter as passed by reference.

compare function clone_access($node):

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/node_clone/...

with:

http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/node_clone/...

where I use the 6.x drupal_alter() API function.

v1nce’s picture

Status: Closed (works as designed) » Closed (fixed)

Understood. Thank you.