I'm not totally sure if this is a CCK issue, or a date module issue, but the export seems to work correctly, so I am thinking it is an issue with content_copy.

I have a content type with a date field. I have the date field 'input type' for day, month, and year set to 'select list'. I export the content type and the field looks like this:


  3 => 
  array (
    'widget_type' => 'date_select',
    'label' => 'Date Published',
    'weight' => '4',
    'default_value' => 'blank',
    'default_value_custom' => '',
    'default_value2' => 'blank',
    'default_value_custom2' => '',
    'input_format' => 'site-wide',
    'input_format_custom' => '',
    'year_range' => '-9:+9',
    'increment' => '1',
    'text_parts' => 
    array (
      'year' => 0,
      'mon' => 0,
      'mday' => 0,
    ),
    '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' => 'j F Y',
    'output_format_custom' => '',
    'output_format_date_long' => 'l, F j, Y - H:i',
    'output_format_custom_long' => '',
    'output_format_date_medium' => 'D, m/d/Y - H:i',
    'output_format_custom_medium' => '',
    'output_format_date_short' => 'm/d/Y - H:i',
    'output_format_custom_short' => '',
    'tz_handling' => 'none',
    'timezone_db' => 'UTC',
    'field_timezone' => 'Australia/Melbourne',
    'field_name' => 'field_book_date',
    'field_type' => 'date',
    'module' => 'date',
    'display_settings' => 
    array (
      'label' => 
      array (
        'format' => 'above',
      ),
      'teaser' => 
      array (
        'format' => 'default',
      ),
      'full' => 
      array (
        'format' => 'default',
      ),
    ),
  ),

This seems to be correct. However, when I delete the ctype and then try to import, it gets created correctly, but my input types are defaulting to 'text field', not 'select list' like they were on export.

This data is stored serialized in the node_field_instance table, field widget_settings. The value stored in the db after import unserializes to this:

Array
(
    [default_value] => blank
    [default_value_custom] => 
    [default_value2] => blank
    [default_value_custom2] => 
    [input_format] => site-wide
    [input_format_custom] => 
    [increment] => 1
    [text_parts] => Array
        (
        )

    [year_range] => -9:+9
)

As you can see the [text_parts] array has no data. It SHOULD look like this:

Array
(
    [default_value] => blank
    [default_value_custom] => 
    [default_value2] => blank
    [default_value_custom2] => 
    [input_format] => site-wide
    [input_format_custom] => 
    [increment] => 1
    [text_parts] => Array
        (
            [year] => 0
            [mon] => 0
            [mday] => 0
        )

    [year_range] => -9:+9
)

Any idea why this is happening? This is about as far as I can go with it.

Comments

KingMoore’s picture

been looking at this a bit more, and I was confused/incorrect above. When working correctly (showing select lists) my widget settings look like this unserialized:

Array
(
    [default_value] => blank
    [default_value_custom] =>
    [default_value2] => blank
    [default_value_custom2] =>
    [input_format] => site-wide
    [input_format_custom] =>
    [increment] => 1
    [text_parts] => Array
        (
        )

    [year_range] => -9:+9
)

When I do an import of the content type it looks like this (and does not work correctly)

Array
(
    [default_value] => blank
    [default_value_custom] =>
    [default_value2] => blank
    [default_value_custom2] =>
    [input_format] => site-wide
    [input_format_custom] =>
    [increment] => 1
    [text_parts] => Array
        (
            [year] => 0
            [mon] => 0
            [mday] => 0
        )

    [year_range] => -9:+9
)

I can't figure it out. If I change my widget_settings field serialized string in the db from this (how it imports):

..."text_parts";a:3:{s:4:"year";i:0;s:3:"mon";i:0;s:4:"mday";i:0;}...

to this (how it saves):

..."text_parts";a:0:{}...

And then clear my cache, it works as it should. Not sure if this is a problem with the content_copy module or the date module

KingMoore’s picture

double...

KingMoore’s picture

strangely enough, it exports like this:

    'text_parts' =>
    array (
      'year' => 0,
      'mon' => 0,
      'mday' => 0,
    ),

but if I change it to this:

    'text_parts' =>
    array (
      'year' => 1,
      'mon' => 1,
      'mday' => 1,
    ),

it imports correctly. I believe I'm missing the underlying problem though.

karens’s picture

Status: Active » Closed (duplicate)

This is coming from the problems in #128038: Critical failures using drupal_execute() on nodes with CCK fields, track it there.