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
- Enable "Show field" options in my content type before export
- Export my content type
- Import my content type
- 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
Comment | File | Size | Author |
---|---|---|---|
page_title_cck_settings.png | 33.92 KB | -enzo- |
Comments
Comment #1
diegohermes CreditAttribution: diegohermes commentedThanks for posting this solution Enzo, i was having the same problem here and your solution works perfectly.