diff -u includes/menu.inc includes/menu.inc --- includes/menu.inc 15 Oct 2009 23:04:07 -0000 +++ includes/menu.inc 16 Oct 2009 03:19:58 -0000 @@ -2275,6 +2275,7 @@ function menu_links_clone($links, $menu_name = NULL) { foreach ($links as &$link) { unset($link['mlid']); + unset($link['plid']); if (isset($menu_name)) { $link['menu_name'] = $menu_name; } @@ -2292,14 +2293,14 @@ */ function menu_load_links($menu_name) { $links = db_select('menu_links', 'ml', array('fetch' => PDO::FETCH_ASSOC)) - ->fields('ml') - ->condition('ml.menu_name', $menu_name) - // Order by weight so as to be helpful for menus that are only one level - // deep. - ->orderBy('weight') - ->execute() - ->fetchAll(); - + ->fields('ml') + ->condition('ml.menu_name', $menu_name) + // Order by weight so as to be helpful for menus that are only one level + // deep. + ->orderBy('weight') + ->execute() + ->fetchAll(); + foreach ($links as &$link) { $link['options'] = unserialize($link['options']); } diff -u modules/shortcut/shortcut.admin.inc modules/shortcut/shortcut.admin.inc --- modules/shortcut/shortcut.admin.inc 15 Oct 2009 23:04:07 -0000 +++ modules/shortcut/shortcut.admin.inc 16 Oct 2009 03:19:58 -0000 @@ -73,6 +73,11 @@ '#access' => $add_access, ); + $form['#attached'] = array( + 'css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.css'), + 'js' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'), + ); + $form['submit'] = array( '#type' => 'submit', '#value' => t('Save configuration'), @@ -131,8 +136,7 @@ */ function theme_shortcut_set_switch($variables) { $form = $variables['form']; - drupal_add_css(drupal_get_path('module', 'shortcut') . '/shortcut.admin.css'); - drupal_add_js(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'); + // Render the textfield for adding a new set inline with the radio button. $form['set']['new']['#title'] = t('New set: !textfield', array('!textfield' => drupal_render($form['new']))); return drupal_render_children($form); } @@ -192,6 +196,12 @@ $form['shortcuts'][$status][$mlid]['edit']['#markup'] = l(t('edit'), 'admin/config/system/shortcut/link/' . $mlid); $form['shortcuts'][$status][$mlid]['delete']['#markup'] = l(t('delete'), 'admin/config/system/shortcut/link/' . $mlid . '/delete'); } + + $form['#attached'] = array( + 'css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.css'), + 'js' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'), + ); + $form['submit'] = array( '#type' => 'submit', '#value' => t('Save Changes'), @@ -229,8 +239,6 @@ */ function theme_shortcut_set_customize($variables) { $form = $variables['form']; - drupal_add_css(drupal_get_path('module', 'shortcut') . '/shortcut.admin.css'); - drupal_add_js(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'); $map = array('disabled' => t('Disabled'), 'enabled' => t('Enabled')); $rows = array(); diff -u modules/shortcut/shortcut.module modules/shortcut/shortcut.module --- modules/shortcut/shortcut.module 15 Oct 2009 23:04:07 -0000 +++ modules/shortcut/shortcut.module 16 Oct 2009 03:19:58 -0000 @@ -479,12 +479,10 @@ */ function shortcut_page_build(&$page) { if (shortcut_set_edit_access()) { - // $_GET['q'] is the unaliased version. - $get = $_GET; - unset($get['q']); $link = $_GET['q']; - if (!empty($get)) { - $link .= '?' . drupal_http_build_query($get); + $query_parameters = drupal_get_query_parameters(); + if (!empty($query_parameters)) { + $link .= '?' . drupal_http_build_query($query_parameters); } $query = array( 'link' => $link, @@ -494,10 +492,10 @@ $query += drupal_get_destination(); $shortcut_set = shortcut_current_displayed_set(); - + $link_text = shortcut_set_switch_access() ? t('Add to %shortcut_set shortcuts', array('%shortcut_set' => $shortcut_set->title)) : t('Add to shortcuts'); $page['add_to_shortcuts'] = array( '#prefix' => '
', - '#markup' => l('' . (shortcut_set_switch_access() ? t('Add to %shortcut_set shortcuts', array('%shortcut_set' => $shortcut_set->title)) : t('Add to shortcuts')) . '', 'admin/config/system/shortcut/' . $shortcut_set->set_name . '/add-link-inline', array('query' => $query, 'html' => TRUE)), + '#markup' => l('' . $link_text . '', 'admin/config/system/shortcut/' . $shortcut_set->set_name . '/add-link-inline', array('query' => $query, 'html' => TRUE)), '#suffix' => '
', ); } @@ -521,7 +519,7 @@ * Implement hook_preprocess_page(). */ function shortcut_preprocess_page(&$variables) { - if (shortcut_set_edit_access()) { + if (isset($variables['page']['add_to_shortcuts'])) { $variables['add_to_shortcuts'] = drupal_render($variables['page']['add_to_shortcuts']); } } diff -u modules/simpletest/tests/menu.test modules/simpletest/tests/menu.test --- modules/simpletest/tests/menu.test 15 Oct 2009 23:04:07 -0000 +++ modules/simpletest/tests/menu.test 16 Oct 2009 03:19:58 -0000 @@ -159,7 +159,7 @@ function testMenuGetNames() { // The main-menu is there but has no items by default, so not returned by // menu_get_names(). Therefore we cannot check for that. - $this->assertEqual(menu_get_names(), array('shortcut-set-1', 'management', 'navigation', 'original', 'user-menu'), t('Expected menu names were returned.')); + $this->assertEqual(menu_get_names(), array('management', 'navigation', 'original', 'shortcut-set-1', 'user-menu'), t('Expected menu names were returned.')); } /**