summaryrefslogtreecommitdiff
path: root/modules/path/path.module
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-06-18 06:59:11 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-06-18 06:59:11 +0000
commitd0c9795c338ed0ccf5c71270c13b43b0e2cfe2e1 (patch)
tree9b2be29f906f045c48de9ad08a77594a4db32729 /modules/path/path.module
parent64707c09e9ae2eb6a388c2c3c081c848555cc2b3 (diff)
downloadbrdo-d0c9795c338ed0ccf5c71270c13b43b0e2cfe2e1.tar.gz
brdo-d0c9795c338ed0ccf5c71270c13b43b0e2cfe2e1.tar.bz2
#150049 by Moshe Weitzman: empower custom url rewriting with url() options
Diffstat (limited to 'modules/path/path.module')
-rw-r--r--modules/path/path.module9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/path/path.module b/modules/path/path.module
index bb1820662..b932a1b66 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -233,11 +233,10 @@ function path_nodeapi(&$node, $op, $arg) {
case 'load':
$path = "node/$node->nid";
- // 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);
+ $language = isset($node->language) ? $node->language : '';
+ $alias = drupal_get_path_alias($path, $language);
+ if ($path != $alias) {
+ $node->path = $alias;
}
break;