Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Get this error when trying to login: Notice: date_default_timezone_set() [function.date-default-timezone-set]: Timezone ID '-18000' is invalid in drupal_session_regenerate
Traced to line 122 in user.inc within the user import "supported" folder:
$account_add['timezone'] = '-18000';
Changed it to a real timezone string and it worked as shown below. This will need to become a lookup to get the current or default Drupal timezone, but was a quick fix for my use case.
$account_add['timezone'] = 'America/Chicago';
Comment | File | Size | Author |
---|---|---|---|
#3 | user_import-fix-for-default-timezone-189722-3.patch | 603 bytes | KevinVb |
#1 | user_import-fix-for-default-timezone-189722-1.patch | 564 bytes | R3ason |
Comments
Comment #1
R3ason CreditAttribution: R3ason commentedComment #2
leanderl CreditAttribution: leanderl commentedI can confirm this bug and that the fix solves the problem. (Using user_import 7.x-2.1 and Drupal 7.25).
Really nice module, keep up the good work!
Comment #3
KevinVb CreditAttribution: KevinVb commentedI'm updating this module to version 1.1. and the same issue is still present.
So i patched it with the use of the default timezone of the website, if that isn't found i use the Europe/Brussels timezone because that's my timezone, but normally when you install Drupal you will always have a default timezone as a variable set in your system except when you wrote code that deletes it. But who does that?
Comment #4
gisleThis seems to ficed in the latest stable release: