After upgrading ExpressionEngine from 2.5.2 to 2.6.1, the Member module now sets the member's localization to PHP format eg. 'Australia/Sydney' in the exp_members table. So, when my site calls EEs Localize class it returns the PHP format instead of the CI format, that is it should return 'UP10' instead of 'Australia/Sydney', generating this error:

Severity: Notice
Message: Undefined index: Australia/Sydney
Filename: libraries/Localize.php
Line Number: 735   

It may be that there is a bug in the javascript generated by the CI Date Helper function timezone_menu(), because the tag should be generated with the latter time zone codes (i.e. Sydney).

The code for the localization_form view is generated on line 1563 of mod.member_settings.php:

'form:localization' =>  ee()->localize->timezone_menu(($query-  >row('timezone')  ==     '') 
? 'UTC' : $query->row('timezone'))

The javascript function that is generated is called 'ee_tz_change' (why the 'ee_' prefix in a CI generated function?).

The mod.member_settings module generates the localization form for the user using the Localize class in the edit_localization() function.

The Localize class uses the CI Date helper timezone_menu() function to generate a localization menu, but this provides the string 'Sydney/Australia' in the tag, which means this is what is passed back to the update_localization() function in mod.member_settings.php.

See line 1593 in mod.member_settings.php:

$data['timezone'] = $_POST['server_timezone'];

Am I missing something really obvious here? Where is this ee_tz_change js function coming from???

  • For what it's worth, I'm getting the same error, with EE 2.7.2. All I did was change my account timezone from "Belarus -> Minsk" (????) to my actual location. It triggered the exact same Undefined index error on the frontend. When I used Firebug to live-edit the My Account -> Localization Settings -> Select Time Zone form, changing <option value="Asia/Jerusalem"> to <option value="UP2"> and submitting it, the problem went away. Have you filed an official bug report I can join in on? – Sandwich Oct 31 '13 at 14:08
  • No Sandwhich, I wasn't certain whether it was actually a bug and I ran out of time so I couldn't pursue it any further. Let me know if you discover anything. – sijpkes Nov 14 '13 at 4:27
  • Reported as a bug here: support.ellislab.com/bugs/detail/19909 – Sandwich Nov 17 '13 at 11:13
  • Thanks for reporting this Sandwhich, I recall I did something similar to my form with the "UP2" thing. Considering we have to pay for the Member module, I would think Ellislabs were more careful with changing this sort of code. Especially since they are so keen for us to upgrade our EE installations regularly. – sijpkes Dec 4 '13 at 1:45
  • If you look at the bug report, the Member module wasn't at fault in my situation - it was an old add-on that hadn't been updated for EE 2.6.x. In your case, the problem probably lies with your code. :-/ – Sandwich Dec 4 '13 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.