When I importing nodes even if there is a path setting the node does not get imported.

What am I doing wrong?

JOsh

Comments

danielb’s picture

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.

danielb’s picture

Status: Active » Postponed (maintainer needs more info)
danielb’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

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.

ngmaloney’s picture

Version: 6.x-1.4 » 6.x-2.9
Status: Closed (fixed) » Active

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?

ngmaloney’s picture

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.

danielb’s picture

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.

James Andres’s picture

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.

James Andres’s picture

Here's a patch for the fix.

danielb’s picture

Status: Active » Fixed

In the new release this will be a configuration option.

Status: Fixed » Closed (fixed)

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

joachim’s picture

Status: Closed (fixed) » Active

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."

danielb’s picture

Status: Active » Closed (fixed)

No and this is not a good place to discuss that idea as it could apply to a more general case.

joachim’s picture

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 :/

danielb’s picture

OK let's discuss this here http://drupal.org/node/610074