Error message: Trying to get property of non-object in drupal6/sites/all/modules/date/date_timezone/date_timezone.module on line 142.

Steps in order to reproduce:
1) Enable Date API and Date Timezone modules.
2) Logout
3) Go to 'user/register'
4) The above listed error message will be displayed.

After a little investigation, I've found that the $account variable is not being set sometimes. (Being somewhat new to drupal development, I have no idea why.)

BTW, this error message appears at several other pages too. If logged in with administration permissions, a similar message appears on 'admin/build/modules' and after clearing the cache using the devel module.

I've attached a patch that fixes this problem. However, I have no idea if this is the correct solution. I hope this helps.

CommentFileSizeAuthor
date_timezone_notice.patch630 byteskevinweber

Comments

karens’s picture

Status: Needs review » Fixed

I've never gotten this message, but checking isset() is a good idea and should take care of the problem. Thanks, patch committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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