Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
I exported a book successfully from drupal 4.5. Now I am trying to import into 4.6 and getting the following error:
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
for the record, that is one line for each node I am trying to import in the XML file. None of those nodes are ID #0, so I'm not sure what the deal is.
Nid is unique id generated by drupal (sequences) so when importing xml with nid, import_export does not import it unless ALLOW_FORCE_NEW_NODE_ID is True. But you should know what you do and manually increase sequencesid after. Safer way is replace nid with xnid. Xnid is a alias string that will be replaced with real nid generated by drupal.
Yes, none of nodes have #0 but no new node is craeted due warning.
function _import_export_node_load_check($action, $nid, $def_type, &$type, &$node, $mand_arr, &$fixups, &$output) {
....
if ($nid) {
$node = _import_export_node_load($nid);
if (!$node->nid && !ALLOW_FORCE_NEW_NODE_ID && $action == 'insert') {
$output .= t('Cannot force new node id');
return false;
}
}
else {
$node = new StdClass();
}
Comments
Comment #1
tma0 commentedDoes not work? I hope there is no system API change.
Comment #2
jesse_idc@civicspacelabs.com commentedI exported a book successfully from drupal 4.5. Now I am trying to import into 4.6 and getting the following error:
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
Cannot force new node id nodeid 0
for the record, that is one line for each node I am trying to import in the XML file. None of those nodes are ID #0, so I'm not sure what the deal is.
Comment #3
tma0 commentedNid is unique id generated by drupal (sequences) so when importing xml with nid, import_export does not import it unless ALLOW_FORCE_NEW_NODE_ID is True. But you should know what you do and manually increase sequencesid after. Safer way is replace nid with xnid. Xnid is a alias string that will be replaced with real nid generated by drupal.
Yes, none of nodes have #0 but no new node is craeted due warning.
Comment #4
walterbyrd commentedCould somebody help me understand what tma0 is posting?
Where do I change nid to xnid? Is this entirely safe? Why is nid used, when only xnid works? Has this been changed? If not, why not?
Thanks.