Skip to content
Snippets Groups Projects
Commit a7aab03a authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #298722 by pwolanin: _menu_translate returns FALSE before to_arg is...

- Patch #298722 by pwolanin: _menu_translate returns FALSE before to_arg is available.  Drupal.org upgrade blocker.
parent 1dafc60c
No related branches found
No related tags found
No related merge requests found
...@@ -589,7 +589,7 @@ function _menu_item_localize(&$item, $map, $link_translate = FALSE) { ...@@ -589,7 +589,7 @@ function _menu_item_localize(&$item, $map, $link_translate = FALSE) {
* *
* Translation of menu item titles and descriptions are done here to * Translation of menu item titles and descriptions are done here to
* allow for storage of English strings in the database, and translation * 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 * @param $router_item
* A menu router item * A menu router item
...@@ -600,21 +600,24 @@ function _menu_item_localize(&$item, $map, $link_translate = FALSE) { ...@@ -600,21 +600,24 @@ function _menu_item_localize(&$item, $map, $link_translate = FALSE) {
* path from the menu table, for example tabs. * path from the menu table, for example tabs.
* @return * @return
* Returns the map with objects loaded as defined in the * 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. * accessible, FALSE otherwise. $item['href'] is set according to the map.
* If an error occurs during calling the load_functions (like trying to load * If an error occurs during calling the load_functions (like trying to load
* a non existing node) then this function return FALSE. * a non existing node) then this function return FALSE.
*/ */
function _menu_translate(&$router_item, $map, $to_arg = 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; $path_map = $map;
if (!_menu_load_objects($router_item, $map)) { if (!_menu_load_objects($router_item, $map)) {
// An error occurred loading an object. // An error occurred loading an object.
$router_item['access'] = FALSE; $router_item['access'] = FALSE;
return 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. // Generate the link path for the page request or local tasks.
$link_map = explode('/', $router_item['path']); $link_map = explode('/', $router_item['path']);
......
...@@ -42,6 +42,7 @@ class TrackerTest extends DrupalWebTestCase { ...@@ -42,6 +42,7 @@ class TrackerTest extends DrupalWebTestCase {
$this->drupalGet('tracker'); $this->drupalGet('tracker');
$this->assertText($page1['title'], t('Nodes show up in the tracker listing.')); $this->assertText($page1['title'], t('Nodes show up in the tracker listing.'));
$this->assertNoText($page2['title'], t('Unpublished nodes do not show up in the tracker listing.')); $this->assertNoText($page2['title'], t('Unpublished nodes do not show up in the tracker listing.'));
$this->assertLink(t('My recent posts'), 0, t('User tab shows up on the global tracker page.'));
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment