diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-06-02 15:06:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-06-02 15:06:09 +0000 |
commit | 34c996e28cea7729ed07d1bec33f51ccca21e607 (patch) | |
tree | 011ebfca6cd25a38b7d59e961d92f102ccf6ded0 /includes | |
parent | 4f2e13f50376a9032f8157563aeb6eede34433eb (diff) | |
download | brdo-34c996e28cea7729ed07d1bec33f51ccca21e607.tar.gz brdo-34c996e28cea7729ed07d1bec33f51ccca21e607.tar.bz2 |
- Patch #358315 by neochief et al: drupal_lookup_path() not respects alias' order.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/path.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/path.inc b/includes/path.inc index fa066aac3..ac08ac4c2 100644 --- a/includes/path.inc +++ b/includes/path.inc @@ -87,7 +87,7 @@ function drupal_lookup_path($action, $path = '', $path_language = '') { // Now fetch the aliases corresponding to these system paths. // We order by ASC and overwrite array keys to ensure the correct // alias is used when there are multiple aliases per path. - $map[$path_language] = db_query("SELECT src, dst FROM {url_alias} WHERE src IN(:system) AND language IN(:language, '') ORDER BY language ASC", array( + $map[$path_language] = db_query("SELECT src, dst FROM {url_alias} WHERE src IN(:system) AND language IN(:language, '') ORDER BY language ASC, pid ASC", array( ':system' => $system_paths, ':language' => $path_language ))->fetchAllKeyed(); @@ -108,7 +108,7 @@ function drupal_lookup_path($action, $path = '', $path_language = '') { // For system paths which were not cached, query aliases individually. else if (!isset($no_aliases[$path_language][$path])) { // Get the most fitting result falling back with alias without language - $alias = db_query("SELECT dst FROM {url_alias} WHERE src = :src AND language IN(:language, '') ORDER BY language DESC", array( + $alias = db_query("SELECT dst FROM {url_alias} WHERE src = :src AND language IN(:language, '') ORDER BY language DESC, pid DESC", array( ':src' => $path, ':language' => $path_language ))->fetchField(); @@ -123,7 +123,7 @@ function drupal_lookup_path($action, $path = '', $path_language = '') { $src = ''; if (!isset($map[$path_language]) || !($src = array_search($path, $map[$path_language]))) { // Get the most fitting result falling back with alias without language - if ($src = db_query("SELECT src FROM {url_alias} WHERE dst = :dst AND language IN(:language, '') ORDER BY language DESC", array( + if ($src = db_query("SELECT src FROM {url_alias} WHERE dst = :dst AND language IN(:language, '') ORDER BY language DESC, pid DESC", array( ':dst' => $path, ':language' => $path_language)) ->fetchField()) { |