Project:Node clone
Version:5.x-2.5
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

AttachmentSize
clone_access-patch.txt464 bytes

Comments

#1

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?

#2

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.

#3

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.

#4

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

Understood. Thank you.