I cant change the dafault time zone in the date settings form, when I tried I get the message:

"An illegal choice has been detected. Please contact the site administrator."

For example the default time zone:

Sunday, June 25 2006, -19:22 +0000

I try to change it to:

Sunday, June 25 2006,- 14:22 -0500

when I submit this change I recive the error message

The administrative logs show:
Type form
Message Illegal choice in Default time zone element.
Severity notice

I am running in Linux, red hat
php 4.3
drupal 4.7

any ideas about what could be the problem, Thanks!

Comments

amnon’s picture

Interesting. Can you attach the source of the form? That is, click "View Source" when you're at that settings page, and do copy&paste into a text file.

quineto’s picture

This is the default drupal system form configuration in "administer >> settings "

and this is the source of the form, only the part where the date settings option are displayed


<div class="description">The default number of items to include in a feed.</div>
</div>
<div class="form-item">
 <label for="edit-feed_item_length">Display of XML feed items:</label>
 <select name="edit[feed_item_length]" class="form-select" id="edit-feed_item_length" ><option value="title">Titles only</option><option value="teaser" selected="selected">Titles plus teaser</option><option value="fulltext">Full text</option></select>
 <div class="description">Global setting for the length of XML feed items that are output by default.</div>
</div>

</fieldset>
<fieldset class=" collapsible collapsed"><legend>Date settings</legend><div class="form-item">
 <label for="edit-date_default_timezone">Default time zone:</label>
 <select name="edit[date_default_timezone]" class="form-select" id="edit-date_default_timezone" ><option value="-39600">Sunday, June 25, 2006 - 11:12 -1100</option><option value="-36000">Sunday, June 25, 2006 - 12:12 -1000</option><option value="-34200">Sunday, June 25, 2006 - 12:42 -0930</option><option value="-32400">Sunday, June 25, 2006 - 13:12 -0900</option><option value="-28800">Sunday, June 25, 2006 - 14:12 -0800</option><option value="-25200">Sunday, June 25, 2006 - 15:12 -0700</option><option value="-21600">Sunday, June 25, 2006 - 16:12 -0600</option><option value="-18000">Sunday, June 25, 2006 - 17:12 -0500</option><option value="-14400">Sunday, June 25, 2006 - 18:12 -0400</option><option value="-12600">Sunday, June 25, 2006 - 18:42 -0330</option><option value="-10800">Sunday, June 25, 2006 - 19:12 -0300</option><option value="-7200">Sunday, June 25, 2006 - 20:12 -0200</option><option value="-3600">Sunday, June 25, 2006 - 21:12 -0100</option><option value="0" selected="selected">Sunday, June 25, 2006 - 22:12 +0000</option><option value="3600">Sunday, June 25, 2006 - 23:12 +0100</option><option value="7200">Monday, June 26, 2006 - 00:12 +0200</option><option value="10800">Monday, June 26, 2006 - 01:12 +0300</option><option value="12600">Monday, June 26, 2006 - 01:42 +0330</option><option value="14400">Monday, June 26, 2006 - 02:12 +0400</option><option value="18000">Monday, June 26, 2006 - 03:12 +0500</option><option value="19800">Monday, June 26, 2006 - 03:42 +0530</option><option value="20700">Monday, June 26, 2006 - 03:57 +0545</option><option value="21600">Monday, June 26, 2006 - 04:12 +0600</option><option value="23400">Monday, June 26, 2006 - 04:42 +0630</option><option value="25200">Monday, June 26, 2006 - 05:12 +0700</option><option value="28800">Monday, June 26, 2006 - 06:12 +0800</option><option value="32400">Monday, June 26, 2006 - 07:12 +0900</option><option value="34200">Monday, June 26, 2006 - 07:42 +0930</option><option value="36000">Monday, June 26, 2006 - 08:12 +1000</option><option value="37800">Monday, June 26, 2006 - 08:42 +1030</option><option value="39600">Monday, June 26, 2006 - 09:12 +1100</option><option value="41400">Monday, June 26, 2006 - 09:42 +1130</option><option value="43200">Monday, June 26, 2006 - 10:12 +1200</option><option value="45900">Monday, June 26, 2006 - 10:57 +1245</option><option value="46800">Monday, June 26, 2006 - 11:12 +1300</option><option value="50400">Monday, June 26, 2006 - 12:12 +1400</option></select>

 <div class="description">Select the default site time zone.</div>
</div>
<div class="form-item">
 <label>Configurable time zones:</label>
 <div class="form-item">
 <label class="option"><input type="radio" name="edit[configurable_timezones]" value="0"   class="form-radio" /> Disabled</label>
</div>
<div class="form-item">
 <label class="option"><input type="radio" name="edit[configurable_timezones]" value="1"  checked="checked"  class="form-radio" /> Enabled</label>

</div>

 <div class="description">Enable or disable user-configurable time zones. When enabled, users can set their own time zone and dates will be updated accordingly.</div>
</div>
<div class="form-item">
 <label for="edit-date_format_short">Short date format:</label>
 <select name="edit[date_format_short]" class="form-select" id="edit-date_format_short" ><option value="Y-m-d H:i" selected="selected">2006-06-25 22:12</option><option value="m/d/Y - H:i">06/25/2006 - 22:12</option><option value="d/m/Y - H:i">25/06/2006 - 22:12</option><option value="Y/m/d - H:i">2006/06/25 - 22:12</option><option value="d.m.Y - H:i">25.06.2006 - 22:12</option><option value="m/d/Y - g:ia">06/25/2006 - 10:12pm</option><option value="d/m/Y - g:ia">25/06/2006 - 10:12pm</option><option value="Y/m/d - g:ia">2006/06/25 - 10:12pm</option><option value="M j Y - H:i">Jun 25 2006 - 22:12</option><option value="j M Y - H:i">25 Jun 2006 - 22:12</option><option value="Y M j - H:i">2006 Jun 25 - 22:12</option><option value="M j Y - g:ia">Jun 25 2006 - 10:12pm</option><option value="j M Y - g:ia">25 Jun 2006 - 10:12pm</option><option value="Y M j - g:ia">2006 Jun 25 - 10:12pm</option></select>

 <div class="description">The short format of date display.</div>
</div>
<div class="form-item">
 <label for="edit-date_format_medium">Medium date format:</label>
 <select name="edit[date_format_medium]" class="form-select" id="edit-date_format_medium" ><option value="D, Y-m-d H:i" selected="selected">Sun, 2006-06-25 22:12</option><option value="D, m/d/Y - H:i">Sun, 06/25/2006 - 22:12</option><option value="D, d/m/Y - H:i">Sun, 25/06/2006 - 22:12</option><option value="D, Y/m/d - H:i">Sun, 2006/06/25 - 22:12</option><option value="F j, Y - H:i">June 25, 2006 - 22:12</option><option value="j F, Y - H:i">25 June, 2006 - 22:12</option><option value="Y, F j - H:i">2006, June 25 - 22:12</option><option value="D, m/d/Y - g:ia">Sun, 06/25/2006 - 10:12pm</option><option value="D, d/m/Y - g:ia">Sun, 25/06/2006 - 10:12pm</option><option value="D, Y/m/d - g:ia">Sun, 2006/06/25 - 10:12pm</option><option value="F j, Y - g:ia">June 25, 2006 - 10:12pm</option><option value="j F Y - g:ia">25 June 2006 - 10:12pm</option><option value="Y, F j - g:ia">2006, June 25 - 10:12pm</option><option value="j. F Y - G:i">25. June 2006 - 22:12</option></select>

 <div class="description">The medium sized date display.</div>
</div>
<div class="form-item">
 <label for="edit-date_format_long">Long date format:</label>
 <select name="edit[date_format_long]" class="form-select" id="edit-date_format_long" ><option value="l, F j, Y - H:i" selected="selected">Sunday, June 25, 2006 - 22:12</option><option value="l, j F, Y - H:i">Sunday, 25 June, 2006 - 22:12</option><option value="l, Y,  F j - H:i">Sunday, 2006,  June 25 - 22:12</option><option value="l, F j, Y - g:ia">Sunday, June 25, 2006 - 10:12pm</option><option value="l, j F Y - g:ia">Sunday, 25 June 2006 - 10:12pm</option><option value="l, Y,  F j - g:ia">Sunday, 2006,  June 25 - 10:12pm</option><option value="l, j. F Y - G:i">Sunday, 25. June 2006 - 22:12</option></select>

 <div class="description">Longer date format used for detailed display.</div>
</div>
<div class="form-item">
 <label for="edit-date_first_day">First day of week:</label>
 <select name="edit[date_first_day]" class="form-select" id="edit-date_first_day" ><option value="0" selected="selected">Sunday</option><option value="1">Monday</option><option value="2">Tuesday</option><option value="3">Wednesday</option><option value="4">Thursday</option><option value="5">Friday</option><option value="6">Saturday</option></select>

 <div class="description">The first day of the week for calendar views.</div>
</div>
</fieldset>
<fieldset class=" collapsible collapsed"><legend>Site maintenance</legend><div class="form-item">
 <label>Site status:</label>
 <div class="form-item">
 <label class="option"><input type="radio" name="edit[site_offline]" value="0"  checked="checked"  class="form-radio" /> Online</label>
</div>

like a comment a few days ago I fixed a problem about PCRE that did not allowed the system to save any data from the global system settings.. this solution is described here http://drupal.org/node/43567

but either before and now the systems does not allowme to change the default time zone.

thanks, I appreciate your help

amnon’s picture

Does it happen only in the time zone select-box?

Other select-boxes work fine?

And does it happen only when you select the -05:00 time zone?

I'll try to explain why drupal complains:

Your browser should send a "-18000" string to drupal, but for some reason, drupal sees a different string, one which is not in the list you see there ("-36000" to "46800"). The question is, what string does drupal see. Unfortunately, I've just discovered a tiny bug in 'form.inc' that doesn't let us see this string in the administrative logs. You should see an "Illegal choice blahblahblah in Default time zone element" message, but instead you only get to see "Illegal choice in Default time zone element" :-(

Do you know how to apply the patch in the above link?

quineto’s picture

Yes, it happen only in the time zone select box and other select boxes work fine.

it happens with all other values that i slect from the menu not only the -05:00 value

thanks amnon

quineto’s picture

Now the form shows this message after I apply the patch in form.inc

Type form
Date Monday, June 26, 2006 - 16:31
User quineto
Message Illegal choice -28800 in Default time zone element.
Severity notice

hellata’s picture

And most likely, it's just another problem with the wretched PHP 4.3.2.

An ugly hack of casting the negative key to integer helped.

In includes/form.inc, replace (line 244)
elseif (!isset($options[$elements['#value']]) )
with
elseif (!isset($options[$elements['#value']]) && !isset($options[(int)$elements['#value']]) )