From f9b5303c8f6b0a7df13268d762621373a4817df3 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Sun, 9 Apr 2006 22:17:40 +0000 Subject: #56421: Make path.module node aliases work when using custom rewrite functions --- modules/path.module | 8 +++++--- modules/path/path.module | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/path.module b/modules/path.module index f6f43125b..160e4a7d0 100644 --- a/modules/path.module +++ b/modules/path.module @@ -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; diff --git a/modules/path/path.module b/modules/path/path.module index f6f43125b..160e4a7d0 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -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; -- cgit v1.2.3