diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-04-09 22:17:40 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2006-04-09 22:17:40 +0000 |
commit | f9b5303c8f6b0a7df13268d762621373a4817df3 (patch) | |
tree | 9a1d67d823038bb74eaec2595e973f7c961865e7 /modules | |
parent | c56896224a12702e21bcf281c5a794610f8bd420 (diff) | |
download | brdo-f9b5303c8f6b0a7df13268d762621373a4817df3.tar.gz brdo-f9b5303c8f6b0a7df13268d762621373a4817df3.tar.bz2 |
#56421: Make path.module node aliases work when using custom rewrite functions
Diffstat (limited to 'modules')
-rw-r--r-- | modules/path.module | 8 | ||||
-rw-r--r-- | modules/path/path.module | 8 |
2 files changed, 10 insertions, 6 deletions
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; |