install_node_export_import_from_file() doesn't work with data from node_export v6.x-2.x
DamienMcKenna - March 15, 2009 - 06:13
| Project: | Install Profile API |
| Version: | 6.x-2.x-dev |
| Component: | CRUD functions and includes |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
In my efforts to get this working with data exported from node_export v6.x-2.x (or manually created) I uncovered two issues:
* The data is exported as a string in array format. In order to be part of a complete statement the eval() line needs to assign the nodes array within the eval() line.
* The function expects an array of node records, so nodes exported individually won't load.
Damien

#1
Fix attached. This needs to be verified to still work with data exported from node_export v6.x-1.x.
#2
Instead of adding the
$multipleparameter, how about just counting/checking the$imported_nodesvariable to see if a wrapping array is necessary?I've attached a totally untested proof-of-concept patch.
#3
Here's a patch to match the newly renamed contrib/node_export.inc in CVS. I've tested it and it correctly imported six nodes that were loaded through individual files.
#4
I have tweaked the patch a bit to better utilize the functions already existing in node_export project. Can you give this a test and see if it works for you?
I also made the node_export "save-edit" hook fire before saving the node, and I made a few cosmetic changes to reflect variables and terminology used in the node_export module.
#5
This patch is working well for me, tested on another project I'm working on. Committed.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.