Hello maintainer and folks

Today I was trying to export a CCK and import in other Drupal Installation, but I was getting a freaking error "An illegal choice has been detected. Please contact the site administrator".

Guess what, I'm the administrator :P

After debugging the import process I realize the fail is because by default all content types in a Drupal Installation with module Page Title enabled, have the option "Show field" unchecked. if this option is unchecked the export process for CCK generate a code like this:

 'page_title' => 
  array (
    'show_field' => 
    array (
      0 => 1,
      'show_field' => false,
    ),
    'pattern' => '',
  )

This definition generate and error in form validation because the function _form_validate in includes/form.inc don't allow false values in checkboxes elements in a form.

So my solution was

  1. Enable "Show field" options in my content type before export
  2. Export my content type
  3. Import my content type
  4. Disable "Show field" options in my content type after import

    Please improve the integration with CCK import , because this error can drive you nuts.

    Regards,

    enzo

CommentFileSizeAuthor
page_title_cck_settings.png33.92 KB-enzo-
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

diegohermes’s picture

Thanks for posting this solution Enzo, i was having the same problem here and your solution works perfectly.