Closed (fixed)
Project:
Node access user reference
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
3 Nov 2008 at 23:37 UTC
Updated:
22 Nov 2008 at 00:51 UTC
I haven't yet tried out this module, but took a few minutes to look at the code and have a couple questions.
= &$ is used during variable assignment. I'm guessing that it works, but it looks like these may be artifacts of some copy-and-paste of variable names from the function declarations.nodeaccess_userreference_node_access_records(), $var_name, $update_name and $delete_name are all created by doing string concatenation with $field['field_name']. Then, in the if statement below, it looks like the grants array will only be added to if $field['field_name'] is an array. If it's an array, then I'm not sure how the string concatenations would have worked. I probably just need to run through the code, but it seems like nodeaccess_userreference_node_access_records() is going to always return an empty array.
Comments
Comment #1
danielb commentedThis is usually because I am assigning a reference to a subset of an array, to make it more convenient to code.
If i have some data in $array['someplace']['anotherplace'][3]['#data'] it is too long for me to keep writing this so I do this:
$data = &$array['someplace']['anotherplace'][3]['#data'];
and from now on this information can be accessed through $data - but it is not a copy of the information (as it would be if I left the & out)
There was a bug here I think, I am updating the module today with my latest code which is better tested. You are a clever one for spotting that without ever using the module!!
Comment #2
danielb commentedShould be good in the new release!