Error is in here
http://api.drupal.org/api/function/user_preferred_language/6

If $account->language is not set & php is set to report all errors then it throws a Undefined property: stdClass::$language error. Happens with UID=0.

Comments

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new777 bytes
marvil07’s picture

StatusFileSize
new475 bytes

maybe !empty instead of isset, but it works

mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community

empty works for me :)
Tested on a site that was producing this error and patch makes it go away.

gábor hojtsy’s picture

Version: 6.x-dev » 7.x-dev

Bugs are fixed in Drupal 7 first. The function is identical, so the patch should apply to D7 just fine (and looks good).

dries’s picture

Can't we remove && $account->language with the extra isset()?

gábor hojtsy’s picture

StatusFileSize
new453 bytes

Yup, the !empty() should already cover that. Looks like a pretty trivial change.

dries’s picture

Version: 7.x-dev » 6.x-dev

Committed to D7. Moving to D6.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed to Drupal 6 as well.

Status: Fixed » Closed (fixed)

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