/*
hook_user() gets called without a valid account.
Merlinofchaos suggested an empty() check but a quick test revealed that more was needed in this case.
A simple empty($account) failed since empty() returns false on a variable containing an empty stdClass Object. Another check was needed resulting in this:
if (empty($account) || !isset($account->uid)) { return; }
The fixed code:
*/
/**
* Implementation of hook_user().
*/
function user_force_term_user($op, &$edit, &$account, $category = NULL) {
if (empty($account) || !
isset($account->
uid)) { return;
}
$uid = $account->uid;
// ...
}