Hi,
first thanks for your module !

I get this error

• Notice: Undefined property: stdClass::$timezone in drupal_get_user_timezone()
• Notice: Undefined property: stdClass::$timezone in system_user_login()

from commerce_checkout_password_commerce_checkout_complete()

some other module get also this error after a user creation,
so I modified the code (after line 167) to reload the account and error disappear.

    $account = user_save('', $fields);

    // Reload the user's account object.
    $account = user_load($account->uid);

Jo

Comments

johaziel created an issue. See original summary.

bharat.kelotra’s picture

This issue is happening because after user save when the module attempts to login user it checks for timezone of user which is not found in global $user variable so it issues a notice of it.

Passing default time zone to user data before user_save seems to fix the notice.
In function commerce_checkout_password_commerce_checkout_complete in the $fields array pass time zone like
$fields = array(
'name' => $name,
'mail' => $mail,
'init' => $mail,
'pass' => $pass,
'roles' => array(),
'status' => 1,
'timezone' => variable_get('date_default_timezone', @date_default_timezone_get()),
);

this will fix the issue.

cravecode’s picture

Thanks for the more detailed followup @bharat.kelotra. I'll try and get your fix merged in to dev soon.

cravecode’s picture

@bharat.kelotra it looks like that was the issue. Thanks again for the suggested fix. I credited you with the commit.

cravecode’s picture

Status: Active » Closed (fixed)