Posted by mrfelton on February 18, 2009 at 11:58am
| Project: | Location |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
I created a content type on one server, exported it with content_copy, and tried to reimport into another Drupal install. I got the following error:
You can't show more empty location forms than the maximum number of locations allowed for this content type.
I did not enable location for this content type, and there appears to be noting about it in the content export. Below is the content of the exported node:
<?php
$content[type] = array (
'name' => 'Panel lead article',
'type' => 'panel_lead_article',
'description' => '',
'title_label' => 'Title',
'body_label' => '',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'promote' => true,
'sticky' => false,
'revision' => false,
),
'language_content_type' => '0',
'upload' => '1',
'addthis_nodetype' => 1,
'forward_display' => 1,
'search_block' => false,
'trackback' => '0',
'i18n_node' => '1',
'old_type' => 'panel_lead_article',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
'content_profile_use' => 0,
'comment' => '0',
'comment_default_mode' => '4',
'comment_default_order' => '1',
'comment_default_per_page' => '50',
'comment_controls' => '3',
'comment_anonymous' => '0',
'comment_subject_field' => '1',
'comment_preview' => '1',
'comment_form_location' => '0',
'print_display' => 0,
'print_display_comment' => 0,
'print_display_urllist' => 0,
'menu' =>
array (
'menu-about---related' => false,
'menu-about-concern' => false,
'menu-administration' => false,
'menu-blog-related-links' => false,
'menu-blogs--feeds' => false,
'devel' => false,
'menu-donate---relate' => false,
'menu-donor---donor-i' => false,
'menu-for-the-media' => false,
'menu-get-involved---1' => false,
'menu-get-involved---' => false,
'menu-get-involved---0' => false,
'menu-get-involved---2' => false,
'menu-important-links' => false,
'menu-in-depth' => false,
'menu-issues' => false,
'menu-make-a-donation' => false,
'navigation' => false,
'menu-other-ways-to-donate-2' => false,
'primary-links' => false,
'menu-resources' => false,
'secondary-links' => false,
),
'xmlsitemap_node_type_priority' => '-1',
'xmlsitemap_old_priority' => '-1',
);
?>
Comments
#1
location.module, line 1760:
<?php// @@@ Dynamic location adding via ahah?
$form['multiple']['add'] = array(
'#type' => 'select',
'#title' => t('Number of locations that can be added at once'),
'#options' => drupal_map_assoc(range(0, 100)),
'#default_value' => isset($old['multiple']['add']) ? $old['multiple']['add'] : 3,
'#description' => t('The number of empty location forms to show when editing.'),
);
?>
Change the default vale from 3 to 0. This also fixes a problem on the node create, where the same validation error occurs if the user does not enable location for a content type, and does not manually change this field from 3 to 0.
#2
Patch attached. Great module.
#3
#4
I was also able to solve this by installing the 6.x-dev instead of the recommended
#5
The structure changed from 3.0 to 3.x-dev (location_node.module now has the relevant code instead of location.module). So, if you don't want to upgrade yet to the dev version, you can use this patch.
#6
duplicate of #380220: Default values for numbers incompatible
#7
Does anyone know if this patch will be applied to a stable build?
#8
Weird, I never got an update notification for the stable rc1 build but it fixes the issue.
#9
Same problem of "Can not import content type when location module is enabled"
Installed dev version of 2010-Jan-23 and all is right with the world.
Thanks!