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

DamienMcKenna - March 15, 2009 - 12:14
Status:active» needs review

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

AttachmentSize
install_profile_api-n402370-node_export_v2.patch 1.28 KB

#2

James Andres - March 20, 2009 - 21:24

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.

AttachmentSize
install_profile_api-james-node_export_v2.patch 845 bytes

#3

DamienMcKenna - June 24, 2009 - 02:55
Version:6.x-2.0» 6.x-2.x-dev

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.

AttachmentSize
install_profile_api-n402370-v4.patch 870 bytes

#4

James Andres - July 9, 2009 - 17:12

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.

AttachmentSize
node_export.new_export_format.patch 1.81 KB

#5

James Andres - July 14, 2009 - 18:18
Status:needs review» fixed

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

#6

System Message - July 28, 2009 - 18:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.