From e22b2153a2a83b1d1eca60c62703514cd09a55aa Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 24 Sep 2010 21:36:22 +0000 Subject: - Patch #140783 by sun: a select list without #default_value() always passes form validation. --- modules/menu/menu.admin.inc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'modules/menu') diff --git a/modules/menu/menu.admin.inc b/modules/menu/menu.admin.inc index 2eac43cb3..181f8f5d3 100644 --- a/modules/menu/menu.admin.inc +++ b/modules/menu/menu.admin.inc @@ -680,22 +680,24 @@ function menu_configure() { $menu_options = menu_get_menus(); $main = variable_get('menu_main_links_source', 'main-menu'); - $main_options = array_merge($menu_options, array('' => t('No Main links'))); $form['menu_main_links_source'] = array( '#type' => 'select', '#title' => t('Source for the Main links'), + '#required' => FALSE, '#default_value' => variable_get('menu_main_links_source', 'main-menu'), - '#options' => $main_options, + '#empty_option' => t('No Main links'), + '#options' => $menu_options, '#tree' => FALSE, '#description' => t('Select what should be displayed as the Main links (typically at the top of the page).'), ); - $secondary_options = array_merge($menu_options, array('' => t('No Secondary links'))); $form['menu_secondary_links_source'] = array( '#type' => 'select', '#title' => t('Source for the Secondary links'), + '#required' => FALSE, '#default_value' => variable_get('menu_secondary_links_source', 'user-menu'), - '#options' => $secondary_options, + '#empty_option' => t('No Secondary links'), + '#options' => $menu_options, '#tree' => FALSE, '#description' => t("Select the source for the Secondary links. An advanced option allows you to use the same source for both Main links (currently %main) and Secondary links: if your source menu has two levels of hierarchy, the top level menu links will appear in the Main links, and the children of the active link will appear in the Secondary links." , array('%main' => $main_options[$main])), ); -- cgit v1.2.3