Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Jan 2010 at 15:37 UTC
Updated:
3 Jan 2014 at 01:08 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
jhodgdonGood catch! It looks like someone changed the first $user to $account, but not the second, a LONG time ago...
It's also a problem in Drupal 7. Should be fixed in both places.
http://api.drupal.org/api/function/hook_node_grants/7
Comment #2
avpadernoI have fixed the example for Drupal 6.
Comment #3
jhodgdonThanks! That one is in the contrib repository. For D7 we need a patch.
Comment #4
jhodgdonHere's a patch for D7. Note that the Doxygen header has the first arg name for the hook as $user, not $account, so I went with that. It is more standard for Drupal to use $user than $account anyway.
Comment #5
jhodgdonAs a note, the D6 doc uses $account consistently (at least as of kiamlaluno's changes) in the doxygen and function example.
Comment #6
dries commentedIt is probably best to always use $account, in order to avoid confusing (and security issues) with the global $user object.
Comment #7
jhodgdonAh, good point. Here's a new patch.
Comment #8
jhodgdonSorry. That was the old patch. Here's the new patch. I hope. This time.
Comment #9
dries commentedCommitted to CVS HEAD. Thanks.