Document: API documentation for hook_user() at http://api.drupal.org/api/5/function/hook_user

Problem: The "load" operation of hook_user() is confusing because of the multiple uses of the word 'load' (this is confusing for myself, and for 91786, 101914, and 57288).

Solution:
Before:

  • "load": The user account is being loaded. The module may respond to this and insert additional information into the user object.

After:

  • "load": The user account is being loaded with user_load(). The module may respond to this and insert additional information into the user object.

Comments

brunodbo’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Documentation in CVS » documentation
brunodbo’s picture

Changed the component to reflect the new component categorization. See http://drupal.org/node/301443.

jhodgdon’s picture

Status: Active » Closed (won't fix)

hook_user() doesn't exist in Drupal 7 (it's hook_user_load() there, since hook_user() has been broken up into pieces in Drupal 7).

So... In looking over the cited issues and this issue report, it looks like the main point of confusion is that you need to call user_load() to get a fully realized user object, and some people thought that the global $user would be fully loaded (apparently it isn't in Drupal 5 anyway). But that's not really related to hook_user(), and I don't think hook_user() needs to mention it.

The Drupal 7 hook_user_load() already has a link to user_load_multiple()...

The Drupal 6/5 hook_user() doc says "a user being loaded", but doesn't link to user_load(). I don't really see that it's confusing, and there are not multiple uses of the word "load" in that documentation.

jhodgdon’s picture

Note that the other part of this issue about documenting $user global is here:
#57287: Document user_load must be called to get fully realized user object