summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2006-04-09 22:17:40 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2006-04-09 22:17:40 +0000
commitf9b5303c8f6b0a7df13268d762621373a4817df3 (patch)
tree9a1d67d823038bb74eaec2595e973f7c961865e7 /modules
parentc56896224a12702e21bcf281c5a794610f8bd420 (diff)
downloadbrdo-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.module8
-rw-r--r--modules/path/path.module8
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;