When the feature is enabled, the new URL alias are not created.

Looking at the code in plugins/path.inc file I've found at line 28:

function path_post_import($node) {
    if(isset($node->nid) && 
       ($path = path_load("node/". $node->nid)) &&
       isset($node->exported_path)
       ) {
      $path['alias'] = $node->exported_path;
      path_save($path);
    }
}

The path is only created when there is a previous one created, for the same source path. It's a nonsense and I thought that must be replaced with something like:

function path_post_import($node) {
  if(isset($node->nid) && isset($node->exported_path)) {
    $path = array(
      'source' => 'node/'.$node->nid,
      'alias' => $node->exported_path,       
    );
    if (isset($node->language)) {
      $path['language'] = $node->language;
    }
    path_save($path);
  }
}

Comments

luisortizramos’s picture

Assigned: luisortizramos » Unassigned
Status: Active » Needs review
StatusFileSize
new739 bytes

I've generated a patch that resolves the problem.

luisortizramos’s picture

Version: 7.x-1.0-alpha4 » 7.x-1.x-dev

Changed issue version to the head, sorry for that.

rvilar’s picture

This patch works for me

pcho’s picture

Status: Needs review » Fixed

Tested and verified. Patch has been applied, and will be added to the next version.

http://drupalcode.org/project/defaultcontent.git/commit/868de49

Status: Fixed » Closed (fixed)

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