Commit f9b5303c authored by Steven Wittens's avatar Steven Wittens
Browse files

#56421: Make path.module node aliases work when using custom rewrite functions

parent c5689622
......@@ -216,9 +216,11 @@ function path_nodeapi(&$node, $op, $arg) {
case 'load':
$path = "node/$node->nid";
$alias = drupal_get_path_alias($path);
if ($alias != $path) {
$node->path = $alias;
// We don't use drupal_get_path_alias() to avoid custom rewrite functions.
// We only care about exact aliases.
$result = db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path);
if (db_num_rows($result)) {
$node->path = db_result($result);
}
break;
......
......@@ -216,9 +216,11 @@ function path_nodeapi(&$node, $op, $arg) {
case 'load':
$path = "node/$node->nid";
$alias = drupal_get_path_alias($path);
if ($alias != $path) {
$node->path = $alias;
// We don't use drupal_get_path_alias() to avoid custom rewrite functions.
// We only care about exact aliases.
$result = db_query("SELECT dst FROM {url_alias} WHERE src = '%s'", $path);
if (db_num_rows($result)) {
$node->path = db_result($result);
}
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment