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);
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | url-alias-are-not-created-1344528.patch | 739 bytes | luisortizramos |
Comments
Comment #1
luisortizramos commentedI've generated a patch that resolves the problem.
Comment #2
luisortizramos commentedChanged issue version to the head, sorry for that.
Comment #3
rvilarThis patch works for me
Comment #4
pcho commentedTested and verified. Patch has been applied, and will be added to the next version.
http://drupalcode.org/project/defaultcontent.git/commit/868de49