summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-02-09 16:27:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-02-09 16:27:35 +0000
commita7aab03a1e700c284e6e14e2dfa23f0b1f61a1d5 (patch)
tree3c1c8c9ebba7410d9600072f98e2bfe50ef323eb /includes
parent1dafc60c266193fff4b93e9334b8fe6fdcc7729f (diff)
downloadbrdo-a7aab03a1e700c284e6e14e2dfa23f0b1f61a1d5.tar.gz
brdo-a7aab03a1e700c284e6e14e2dfa23f0b1f61a1d5.tar.bz2
- Patch #298722 by pwolanin: _menu_translate returns FALSE before to_arg is available. Drupal.org upgrade blocker.
Diffstat (limited to 'includes')
-rw-r--r--includes/menu.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index c16e6cde1..816b535ef 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -589,7 +589,7 @@ function _menu_item_localize(&$item, $map, $link_translate = FALSE) {
*
* Translation of menu item titles and descriptions are done here to
* allow for storage of English strings in the database, and translation
- * to the language required to generate the current page
+ * to the language required to generate the current page.
*
* @param $router_item
* A menu router item
@@ -600,21 +600,24 @@ function _menu_item_localize(&$item, $map, $link_translate = FALSE) {
* path from the menu table, for example tabs.
* @return
* Returns the map with objects loaded as defined in the
- * $item['load_functions. $item['access'] becomes TRUE if the item is
+ * $item['load_functions']. $item['access'] becomes TRUE if the item is
* accessible, FALSE otherwise. $item['href'] is set according to the map.
* If an error occurs during calling the load_functions (like trying to load
* a non existing node) then this function return FALSE.
*/
function _menu_translate(&$router_item, $map, $to_arg = FALSE) {
+ if ($to_arg) {
+ // Fill in missing path elements, such as the current uid.
+ _menu_link_map_translate($map, $router_item['to_arg_functions']);
+ }
+ // The $path_map saves the pieces of the path as strings, while elements in
+ // $map may be replaced with loaded objects.
$path_map = $map;
if (!_menu_load_objects($router_item, $map)) {
// An error occurred loading an object.
$router_item['access'] = FALSE;
return FALSE;
}
- if ($to_arg) {
- _menu_link_map_translate($path_map, $router_item['to_arg_functions']);
- }
// Generate the link path for the page request or local tasks.
$link_map = explode('/', $router_item['path']);