I've just upgraded from 2.0-rc6 to 2.0 and I am now getting the following error when trying to preview a content-type (created using CCK) when the, optional, date fields are left blank:
There are errors in Data Collection:
The To date must be greater than the From date.
I didn't have this problem with 2.0-rc6
I'm running PHP 5.2.6
The export of the field follows:
$content[type] = array (
'name' => 'Dataset Details',
'type' => 'dataset_details',
'description' => 'A set of data gathered as part of a research project.',
'title_label' => 'Name',
'body_label' => '',
'min_word_count' => '0',
'help' => '<em>This is where the submission guidelines would go .....</em>',
'node_options' =>
array (
'status' => false,
'promote' => false,
'sticky' => false,
'revision' => false,
),
'upload' => '0',
'old_type' => 'dataset_details',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
'comment' => '0',
'comment_default_mode' => '4',
'comment_default_order' => '1',
'comment_default_per_page' => '50',
'comment_controls' => '3',
'comment_anonymous' => 0,
'comment_subject_field' => '1',
'comment_preview' => '1',
'comment_form_location' => '0',
'composite_enabled' => 0,
'composite_referenceable_types' =>
array (
'article' => false,
'book' => false,
'dataset_details' => false,
'forum' => false,
'front_page' => false,
'image' => false,
'page' => false,
'topic_overview' => false,
),
'composite_advanced_view' => '--',
'composite_advanced_view_args' => '',
);
$content[fields] = array (
0 =>
array (
'label' => 'Data Collection',
'field_name' => 'field_dataset_collection_dates',
'type' => 'date',
'widget_type' => 'date_text',
'change' => 'Change basic information',
'weight' => '5',
'default_value' => 'blank',
'default_value2' => 'blank',
'default_value_code' => '',
'default_value_code2' => '',
'input_format' => 'j M Y - g:i:sa',
'input_format_custom' => 'Y',
'advanced' =>
array (
'label_position' => 'above',
'text_parts' =>
array (
'year' => 0,
'month' => 0,
'day' => 0,
'hour' => 0,
'minute' => 0,
'second' => 0,
),
),
'increment' => 1,
'year_range' => '-3:+3',
'label_position' => 'above',
'text_parts' =>
array (
),
'description' => 'Enter the dates of the earliest and latest data included in the dataset.',
'group' => false,
'required' => 0,
'multiple' => '0',
'repeat' => 0,
'todate' => 'optional',
'granularity' =>
array (
'year' => 'year',
),
'default_format' => 'field_dataset_collection_dates_default',
'tz_handling' => 'none',
'timezone_db' => '',
'op' => 'Save field settings',
'module' => 'date',
'widget_module' => 'date',
'columns' =>
array (
'value' =>
array (
'type' => 'varchar',
'length' => 20,
'not null' => false,
'sortable' => true,
'views' => true,
),
'value2' =>
array (
'type' => 'varchar',
'length' => 20,
'not null' => false,
'sortable' => true,
'views' => false,
),
),
'display_settings' =>
array (
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'field_dataset_collection_dates_default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'field_dataset_collection_dates_default',
'exclude' => 0,
),
4 =>
array (
'format' => 'field_dataset_collection_dates_default',
'exclude' => 0,
),
2 =>
array (
'format' => 'field_dataset_collection_dates_default',
'exclude' => 0,
),
3 =>
array (
'format' => 'field_dataset_collection_dates_default',
'exclude' => 0,
),
'token' =>
array (
'format' => 'field_dataset_collection_dates_default',
'exclude' => 0,
),
),
),
);
$content[extra] = array (
'title' => '-5',
'menu' => '-3',
'taxonomy' => '-4',
);
Comments
Comment #1
mjohnq3 commentedCheck out this thread: http://drupal.org/node/348394
Comment #2
pauline_perren commentedThis isn't the same case it seems. I have set both To and From dates to be "Blank" by default and I don't enter any data in either (the date field is set to Optional) and I get this error message anyway.
Comment #3
mjohnq3 commentedI just updated both the Calendar and Date modules from 6.x-2.0-rc6 to 6.x-2.0 on my local test installation of Drupal 6.8. With the default values for the 'To' and 'From' fields set to Blank under the Event settings and the 'Required' checkbox unchecked and the 'To Date' set to Optional under the Global settings I do not receive an error under the conditions you describe.
Perhaps the Developer/Maintainer of these modules can investigate further.
Comment #4
karens commentedThis is a duplicate report about a bug that was specific to the text widget when used with a 'Year only' granularity. I committed fixes for that today.