This is really just a documentation issue, but since $user is a global variable, clarity in the doxygen documentation will be added by fixing this.


Change function hook_user_login(&$edit, $account) to function hook_user_login(&$edit, $user)

function hook_user_login(&$edit, $account) {
  // If the user has a NULL time zone, notify them to set a time zone.
  if (!$user->timezone && variable_get('configurable_timezones', 1) && variable_get('empty_timezone_message', 0)) {
    drupal_set_message(t('Configure your <a href="@user-edit">account time zone setting</a>.', array('@user-edit' => url("user/$user->uid/edit", array('query' => drupal_get_destination(), 'fragment' => 'edit-timezone')))));
  }
}
CommentFileSizeAuthor
#1 hook-user-login-account.patch1.03 KBmr.baileys

Comments

mr.baileys’s picture

Version: 7.0-beta2 » 7.x-dev
Component: user.module » documentation
Priority: Minor » Normal
Status: Active » Needs review
StatusFileSize
new1.03 KB

Good catch, definitely a bug.

mr.baileys’s picture

Title: hook_user_login in user.api.php uses account and user variables when one or the other should be used » Mismatched argument/variables in hook_user_login() documentation.
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Gracious! Good catch.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.