I have a node with two date fields. The first one has a start and end date, uses multiple dates, and goes down to minutes. The second field is a single date, uses no multiple dates, and goes down to days.

The second date will revert to January 1, 2008 when I save, no matter what I set in the edit field. The first date works perfectly.

I think it is a bug introduced later than date-5.x-2.0-rc. I first noticed this bug when I upgraded to date-5.x-2.0-dev two days ago. Before that I had only used date-rc.

This bug is 100% reproducible in every single node I create using this field.

Comments

karens’s picture

Status: Active » Postponed (maintainer needs more info)

This may be the same as http://drupal.org/node/273344, which I've never been able to reproduce.

Can you export the fields info (using Content Copy) and tell me what version of PHP, MYSQL, etc you are using.

will_in_wi’s picture

MySQL database 5.0.51a
PHP 5.2.6
Web server Apache/1.3.34 Ben-SSL/1.55

Anything else?

$content[type]  = array (
  'name' => 'Field Trip',
  'type' => 'field_trip',
  'description' => 'Create a field trip that people can sign up for.',
  'title_label' => 'Title',
  'body_label' => 'Description',
  'min_word_count' => '0',
  'help' => '',
  'node_options' => 
  array (
    'status' => true,
    'revision' => true,
    'promote' => false,
    'sticky' => false,
  ),
  'comment' => '0',
  'upload' => '1',
  'print_display' => 1,
  'signup_node_default_state' => 'enabled_on',
  'signup_form_date' => '',
  'show_preview_changes' => true,
  'old_type' => 'field_trip',
  'orig_type' => '',
  'module' => 'node',
  'custom' => '1',
  'modified' => '1',
  'locked' => '0',
  'fivestar' => 0,
  'fivestar_stars' => 5,
  'fivestar_labels_enable' => 1,
  'fivestar_label_0' => 'Cancel rating',
  'fivestar_label_1' => 'Poor',
  'fivestar_label_2' => 'Okay',
  'fivestar_label_3' => 'Good',
  'fivestar_label_4' => 'Great',
  'fivestar_label_5' => 'Awesome',
  'fivestar_label_6' => 'Give it @star/@count',
  'fivestar_label_7' => 'Give it @star/@count',
  'fivestar_label_8' => 'Give it @star/@count',
  'fivestar_label_9' => 'Give it @star/@count',
  'fivestar_label_10' => 'Give it @star/@count',
  'fivestar_style' => 'average',
  'fivestar_text' => 'dual',
  'fivestar_title' => 1,
  'fivestar_feedback' => 1,
  'fivestar_unvote' => 0,
  'fivestar_position_teaser' => 'hidden',
  'fivestar_position' => 'below',
  'fivestar_comment' => 0,
);
$content[fields]  = array (
  0 => 
  array (
    'widget_type' => 'cck_address',
    'label' => 'Address',
    'weight' => '-4',
    'description' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '',
    'state_abbrv' => '0',
    'country_abbrv' => 0,
    'other_countries' => 0,
    'clist' => 
    array (
      'US' => true,
    ),
    'fielddisplay' => 
    array (
      'field_display_street1' => true,
      'field_display_city' => true,
      'field_display_state' => true,
      'field_display_zip' => true,
      'field_display_street2' => false,
      'field_display_apt' => false,
      'field_display_country' => false,
      'field_display_other' => false,
    ),
    'max_length_street1' => '',
    'max_length_street2' => '',
    'max_length_apt' => '',
    'max_length_city' => '',
    'max_length_other' => '',
    'field_names_street1' => 'Address',
    'field_names_street2' => 'Address continued',
    'field_names_apt' => 'Apt/suite number',
    'field_names_city' => 'City',
    'field_names_state' => 'State',
    'field_names_zip' => 'ZIP',
    'field_names_country' => 'Country',
    'field_names_other' => 'Other',
    'field_order' => 
    array (
      'street1' => '1',
      'street2' => '2',
      'apt' => '3',
      'city' => '4',
      'state' => '5',
      'zip' => '6',
      'country' => '7',
      'other' => '8',
    ),
    'field_defaults_street1' => '',
    'field_defaults_street2' => '',
    'field_defaults_apt' => '',
    'field_defaults_city' => '',
    'field_defaults_state' => 'MN',
    'field_defaults_zip' => '',
    'field_defaults_country' => 'US',
    'field_defaults_other' => '',
    'field_name' => 'field_address',
    'field_type' => 'cck_address',
    'module' => 'cck_address',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),
  1 => 
  array (
    'widget_type' => 'computed',
    'label' => 'Map',
    'weight' => '-4',
    'description' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'code' => '$street = urlencode($node->field_address[0][\'street1\']);
$city = urlencode($node->field_address[0][\'city\']);
$state = urlencode($node->field_address[0][\'state\']);
$zip = urlencode($node->field_address[0][\'zip\']);

$node_field[0][\'value\'] = "<a href=\'http://maps.google.com/maps?f=q&hl=en&geocode=&q=$street,+$city,+$state+$zip&ie=UTF8&z=16&iwloc=addr\'>Google Map</a>";
//print_r($node->field_address[0]);',
    'display' => '$street = urlencode($node->field_address[0][\'street1\']);
$city = urlencode($node->field_address[0][\'city\']);
$state = urlencode($node->field_address[0][\'state\']);
$zip = urlencode($node->field_address[0][\'zip\']);

$node_field[0][\'value\'] = "<a href=\'http://maps.google.com/maps?f=q&hl=en&geocode=&q=$street,+$city,+$state+$zip&ie=UTF8&z=16&iwloc=addr\'>Google Map</a>";
//print_r($node->field_address[0]);',
    'display_format' => '$display = $node_field_item[\'value\'];',
    'store' => 0,
    'data_type' => 'varchar',
    'data_length' => '',
    'data_default' => '',
    'data_not_null' => 0,
    'data_sortable' => 1,
    'field_name' => 'field_map',
    'field_type' => 'computed',
    'module' => 'computed_field',
  ),
  2 => 
  array (
    'widget_type' => 'date_popup',
    'label' => 'Date',
    'weight' => '-3',
    'default_value' => 'blank',
    'default_value_code' => '',
    'default_value2' => 'same',
    'default_value_code2' => '',
    'input_format' => 'm/d/Y h:i:sA',
    'input_format_custom' => '',
    'year_range' => '-3:+3',
    'increment' => '1',
    'advanced' => 
    array (
      'label_position' => 'above',
      'text_parts' => 
      array (
        'year' => 0,
        'month' => 0,
        'day' => 0,
        'hour' => 0,
        'minute' => 0,
        'second' => 0,
      ),
    ),
    'description' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '1',
    'repeat' => 0,
    'todate' => 'optional',
    'granularity' => 
    array (
      'year' => 'year',
      'month' => 'month',
      'day' => 'day',
      'hour' => 'hour',
      'minute' => 'minute',
    ),
    'output_format_date' => 'l, F j, Y - g:ia',
    'output_format_custom' => '',
    'output_format_date_long' => 'l, F j, Y - g:ia',
    'output_format_custom_long' => '',
    'output_format_date_medium' => 'D, m/d/Y - g:ia',
    'output_format_custom_medium' => '',
    'output_format_date_short' => 'm/d/Y - g:ia',
    'output_format_custom_short' => '',
    'tz_handling' => 'user',
    'timezone_db' => 'UTC',
    'repeat_collapsed' => 0,
    'field_name' => 'field_trip_date',
    'field_type' => 'date',
    'module' => 'date',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'inline',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),
  3 => 
  array (
    'widget_type' => 'email',
    'label' => 'Email',
    'weight' => '-3',
    'size' => '60',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_email_0' => 
      array (
        0 => 
        array (
          'email' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'field_name' => 'field_email_0',
    'field_type' => 'email',
    'module' => 'email',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'inline',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),
  4 => 
  array (
    'widget_type' => 'text',
    'label' => 'Leader',
    'weight' => '-3',
    'rows' => '1',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_leader' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_leader',
    'field_type' => 'text',
    'module' => 'text',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'inline',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),
  5 => 
  array (
    'widget_type' => 'phone',
    'label' => 'Phone Number',
    'weight' => '-3',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_phone_number' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '1',
    'multiple' => '0',
    'phone_country_code' => 0,
    'ca_phone_separator' => '-',
    'ca_phone_parentheses' => 1,
    'field_name' => 'field_phone_number',
    'field_type' => 'ca_phone',
    'module' => 'phone',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'inline',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),
  6 => 
  array (
    'widget_type' => 'date_popup',
    'label' => 'Reserve By',
    'weight' => '-2',
    'default_value' => 'blank',
    'default_value_code' => '',
    'default_value2' => 'same',
    'default_value_code2' => '',
    'input_format' => 'm/d/Y h:i:sA',
    'input_format_custom' => '',
    'year_range' => '-0:+3',
    'increment' => '1',
    'advanced' => 
    array (
      'label_position' => 'above',
      'text_parts' => 
      array (
        'year' => 0,
        'month' => 0,
        'day' => 0,
        'hour' => 0,
        'minute' => 0,
        'second' => 0,
      ),
    ),
    'description' => '',
    'group' => false,
    'required' => '0',
    'multiple' => '0',
    'repeat' => 0,
    'todate' => '',
    'granularity' => 
    array (
      'year' => 'year',
      'month' => 'month',
      'day' => 'day',
    ),
    'output_format_date' => 'l, F j, Y',
    'output_format_custom' => '',
    'output_format_date_long' => 'l, F j, Y - g:ia',
    'output_format_custom_long' => '',
    'output_format_date_medium' => 'D, m/d/Y - g:ia',
    'output_format_custom_medium' => '',
    'output_format_date_short' => 'm/d/Y - g:ia',
    'output_format_custom_short' => '',
    'tz_handling' => 'none',
    'timezone_db' => 'UTC',
    'repeat_collapsed' => 0,
    'field_name' => 'field_reserve_by',
    'field_type' => 'date',
    'module' => 'date',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'inline',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),
  7 => 
  array (
    'widget_type' => 'text',
    'label' => 'Cost',
    'weight' => '-1',
    'rows' => '1',
    'description' => '',
    'default_value_widget' => 
    array (
      'field_cost' => 
      array (
        0 => 
        array (
          'value' => '',
        ),
      ),
    ),
    'default_value_php' => '',
    'group' => false,
    'required' => '0',
    'multiple' => '0',
    'text_processing' => '0',
    'max_length' => '',
    'allowed_values' => '',
    'allowed_values_php' => '',
    'field_name' => 'field_cost',
    'field_type' => 'text',
    'module' => 'text',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'inline',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),
);
will_in_wi’s picture

It looks like it could be similar to #273344: Date Popup inserts wrong dates for empty dates. Not sure though.

karens’s picture

Yay! I can reproduce the problem finally! Now I can try to find the fix. Thanks :)

karens’s picture

Status: Postponed (maintainer needs more info) » Fixed

This turned out to be the perfect example for fixing this because you had one field that had the original problem I was trying to fix and one that got broken by the fix. I fixed the fix and it broke the first date again, but then I found a way to fix both. Hopefully all is well now :)

Thanks!

will_in_wi’s picture

It works for me! Thanks! That was really quick!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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