After exporting following element (Date):
0 =>
array (
'widget_type' => 'date_text',
'label' => 'Data urodzin',
'weight' => '0',
'default_value' => 'blank',
'default_value_custom' => '',
'default_value2' => 'blank',
'default_value_custom2' => '',
'input_format' => 'site-wide',
'input_format_custom' => '',
'description' => '',
'group' => false,
'required' => '0',
'multiple' => '0',
'todate' => '',
'granularity' =>
array (
'Y' => true,
'M' => true,
'D' => true,
0 => 1,
'H' => false,
'N' => false,
'S' => false,
),
'output_format_date' => 'Y-m-d',
'output_format_custom' => '',
'output_format_date_long' => 'l, Y, F j - H:i',
'output_format_custom_long' => '',
'output_format_date_medium' => 'D, Y-m-d H:i',
'output_format_custom_medium' => '',
'output_format_date_short' => 'Y-m-d H:i',
'output_format_custom_short' => '',
'tz_handling' => 'none',
'timezone_db' => 'UTC',
'field_timezone' => 'Europe/Warsaw',
'field_name' => 'field_data_ur',
'field_type' => 'date',
'module' => 'date',
),
);
...and importing again, I've got errors:
An illegal choice has been detected. Please contact the site administrator. (from filter_form_validate() function in filter module)
And from logs:
Type form
Date Friday, 2008, January 25 - 11:37
Message Illegal choice 0 in Granularity element.
Severity error
Hostname 127.0.0.1
There is issue with exporting element (cck module or date module issue).
Should be:
'granularity' =>
array (
'Y' => true,
'M' => true,
'D' => true,
'H' => false,
'N' => false,
'S' => false,
),
instead of:
'granularity' =>
array (
'Y' => true,
'M' => true,
'D' => true,
0 => 1,
'H' => false,
'N' => false,
'S' => false,
),
The problem is with '0 => 1', without this is working fine.
Comments
Comment #1
kenorb commentedThe same with 'referenceable_types':
Comment #2
gddsubscribe
Comment #3
kenorb commentedFor 0 => 1 problem in 'referenceable_types', 'referenceable_roles', etc. sections:
patch is here: http://drupal.org/node/216295
For nodereferences problem (with invalid default value), patch in attachment.
For granularity problem after exporting invalid data:
you can fix it manually settings correct values to e.g.
P.S. If you have still 'An illegal choice has been detected.' message:
- And you have still 0 => 1 values after exporting, clear the cache and try to check in database in node_field table, global_settings row on selected field:
'field_some_name', 'nodereference', 'a:1:{s:19:"referenceable_types";a:52:{i:1;i:1;i:0;i:1; ...
delete i.e. "i:1;i:1;i:0;i:1;" (it's equals to: 1 => 1, 0 => 1)
- If you got: 'The default value is invalid.' error, try to disable 'required' (set to '0').
Comment #4
gddPatch applied and my export works now. This was a really complex content type with about 30 CCK fields and it imported perfectly, which is great since I was not relishing recreating it by hand a few more times as I deploy. +1 and thanks.
Comment #5
kenorb commentedSometimes there is another bug with default value, there are two similar sections after exporting:
Just delete one ('default_value') and should be working fine.
Comment #6
karens commentedSame problem as #128038: Critical failures using drupal_execute() on nodes with CCK fields, tracking it there.