diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-06-01 21:58:46 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-06-01 21:58:46 +0000 |
commit | fbbf51051159d9ace934d206f63e5b3061c0a767 (patch) | |
tree | 9b445dbd4e6a1745634cd7da233ebff58528594e /modules/path/path.module | |
parent | 6482708fe7ab60fff4bb94dd747e623c11e9126d (diff) | |
download | brdo-fbbf51051159d9ace934d206f63e5b3061c0a767.tar.gz brdo-fbbf51051159d9ace934d206f63e5b3061c0a767.tar.bz2 |
- Patch #8105 by mathias: made the menu system aware of path aliases.
Diffstat (limited to 'modules/path/path.module')
-rw-r--r-- | modules/path/path.module | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/path/path.module b/modules/path/path.module index 5ac3cc982..d72c56690 100644 --- a/modules/path/path.module +++ b/modules/path/path.module @@ -175,7 +175,11 @@ function path_nodeapi(&$node, $op, $arg) { // viewing of the form. If it is the first time, load the alias, if it isn't // (i.e., user has clicked preview) let them work with their current form alias. if (is_null($node->path)) { - $node->path = drupal_get_path_alias("node/view/$node->nid"); + $path = "node/view/$node->nid"; + $alias = drupal_get_path_alias($path); + if ($alias != $path) { + $node->path = $alias; + } } else { $node->path = trim($node->path); @@ -205,8 +209,9 @@ function path_nodeapi(&$node, $op, $arg) { break; case 'delete': - if ($alias = drupal_get_path_alias("node/view/$node->nid")) { - path_set_alias("node/view/$node->nid"); + $path = "node/view/$node->nid"; + if (drupal_get_path_alias($path) != $path) { + path_set_alias($path); } break; } |