path not being set
sanguis - February 25, 2009 - 17:47
| Project: | Node Export |
| Version: | 6.x-2.9 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
When I importing nodes even if there is a path setting the node does not get imported.
What am I doing wrong?
JOsh

#1
No idea. Are you experiencing problems in one particular situation, or have you not been able to get the module to work at all? Can you try on a really basic node type?
Also make sure the same modules are enabled on both sites, and the content type and it's fields are set up the same way on both sites.
#2
#3
Please try the latest versions 2.x, there have been a few bug fixes. Feel free to reopen if you still encounter this path thing.
#4
I'm running node_export 6.x-2.9 on a vanilla Drupal 6.12 install. The export returns NULL as the path. I created a test node, saved it, and ran the export. Below are the results:
array('nid' => NULL,
'type' => 'page',
'language' => '',
'uid' => '1',
'status' => '1',
'created' => NULL,
'changed' => '1244834819',
'comment' => '0',
'promote' => '0',
'moderate' => '0',
'sticky' => '0',
'tnid' => '0',
'translate' => '0',
'vid' => NULL,
'revision_uid' => '1',
'title' => 'Test Node Export',
'body' => 'This is a test for a node export page. The page should be \'node-export\'',
'teaser' => 'This is a test for a node export page. The page should be \'node-export\'',
'log' => '',
'revision_timestamp' => '1244834819',
'format' => '1',
'name' => 'admin',
'picture' => '',
'data' => 'a:4:{s:13:\"form_build_id\";s:37:\"form-cb95b073297b9a12179a884bb859ef59\";s:14:\"picture_delete\";s:0:\"\";s:14:\"picture_upload\";s:0:\"\";s:7:\"contact\";i:0;}',
'path' => NULL,
'last_comment_timestamp' => '1244834819',
'last_comment_name' => NULL,
'comment_count' => '0',
'taxonomy' => array(),
'files' => array(),
'menu' => NULL,
'#_export_node_encode_object' => '1',
)
Any ideas on what could be causing the PATH not to export?
#5
I made a quick modification to node_export.pages.inc that seemed to resolve the problem.
On line 69 there is the following line of code:
$node->path = NULL;I changed it to:
$node->path = $original_node->path;and that seems to have resolved the problem. I'd be happy to submit a patch if needed.
#6
Could probably just remove that line. Don't worry about a patch, I'll look into this a bit further - perhaps there are other fields that should be transferred that aren't, and maybe I will have to make it configurable just in case it messes with anybody's expectations.
#7
Also watch out for the pathauto module. The default settings for pathauto are to destroy your path and create a new "pathauto-ish" one. Either change that default setting, or tweak your node exports like this:
Original node code:
array(
... snip ...
'path' => NULL,
... snip ...
)
Pathauto "fixed" node code:
array(
... snip ...
'path' => 'my/crazy-path',
'pathauto_perform_alias' => FALSE,
... snip ...
)
Hopefully somebody finds that helpful :-)
James.
#8
Here's a patch for the fix.
#9
In the new release this will be a configuration option.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.
#11
A notification at the top of admin/content/import or when the node is created would be very useful, otherwise this behaviour looks like a bug!
Something like:
"The imported node's path, authored date and whatever have been reset. This behaviour can be changed in the settings."
#12
No and this is not a good place to discuss that idea as it could apply to a more general case.
#13
Unexpected, undocumented behaviour looks like a bug to the user. That's a general principle.
Second principle: users will start using your module without first going to the settings page.
So some kind of notification of what is going on would be polite.
I can file a new bug if you like, though if you're just going to close it there's not much point :/
#14
OK let's discuss this here http://drupal.org/node/610074