I have tried on multiple 5.x sites and have never been able to successfully copy a content type from one site to another. Both sites have the exact same modules installed and enabled. I get the following errors every time:
* An illegal choice has been detected. Please contact the site administrator.
* An illegal choice has been detected. Please contact the site administrator.
An error has occured adding the content type news.
Please check the errors displayed for more details.
For the record, please also note the typo in the third line of the error message. ;-)
Here's the code I attempted to import:
$content[type] = array (
'name' => 'News Article',
'type' => 'news',
'description' => '',
'title_label' => 'Title',
'body_label' => 'Body',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'promote' => false,
'sticky' => false,
'revision' => false,
),
'comment' => '0',
'event_nodeapi' => 'never',
'forward_display_' => '1',
'image_attach' => '0',
'upload' => '1',
'old_type' => 'news',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
'location_maxnum' => '0',
'location_defaultnum' => '0',
'location_weight' => '9',
'location_collapsible' => 1,
'location_collapsed' => 1,
'location_addanother' => 0,
'location_name' => '',
'location_street' => '',
'location_city' => '0',
'location_province' => '0',
'location_postal_code' => '0',
'location_country' => '1',
);
Now, interestingly, if I remove all of the location_... options, the type is created successfully. So the problem here would seem to be a compatibility issue.
Comments
Comment #1
seanrNarrowed it down to this:
Change those values to zeros and it works. This now looks like a locations issue (I'm filing a separate issue since it's related to the defaults for each node type for location), but it'd still be nice of CCK dealt with that a little more gracefully.
Comment #2
sirkitree commentedMarking this as a duplicate of http://drupal.org/node/128038 -- there are more detailed bug reports there.