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

Comments

damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

Fix attached. This needs to be verified to still work with data exported from node_export v6.x-1.x.

James Andres’s picture

Instead of adding the $multiple parameter, how about just counting/checking the $imported_nodes variable to see if a wrapping array is necessary?

I've attached a totally untested proof-of-concept patch.

damienmckenna’s picture

Version: 6.x-2.0 » 6.x-2.x-dev
StatusFileSize
new870 bytes

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.

James Andres’s picture

StatusFileSize
new1.81 KB

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.

James Andres’s picture

Status: Needs review » Fixed

This patch is working well for me, tested on another project I'm working on. Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.