Issue #1830936 by mtunay, vijaycs85: Convert the 'menu_override_parent_selector()' variable to CMI.

8.0.x
webchick 2012-12-29 00:41:32 -08:00
parent f95db7d468
commit 8134fec458
4 changed files with 16 additions and 4 deletions

View File

@ -460,7 +460,7 @@ function book_pick_book_nojs_submit($form, &$form_state) {
* A parent selection form element.
*/
function _book_parent_select($book_link) {
if (variable_get('menu_override_parent_selector', FALSE)) {
if (config('menu.settings')->get('override_parent_selector')) {
return array();
}
// Offer a message or a drop-down to choose a different parent page.

View File

@ -1,2 +1,3 @@
main_links: main
secondary_links: account
override_parent_selector: '0'

View File

@ -115,3 +115,14 @@ function menu_update_8002() {
->execute();
}
/**
* Moves menu_override_parent_selector from variables to config.
*
* @ingroup config_upgrade
*/
function menu_update_8003() {
update_variables_to_config('menu.settings', array(
'menu_override_parent_selector' => 'override_parent_selector',
));
}

View File

@ -354,14 +354,14 @@ function menu_delete($menu) {
* and mlid. The list excludes the given item and its children.
*
* @todo This has to be turned into a #process form element callback. The
* 'menu_override_parent_selector' variable is entirely superfluous.
* 'override_parent_selector' variable is entirely superfluous.
*/
function menu_parent_options($menus, $item, $type = '') {
// The menu_links table can be practically any size and we need a way to
// allow contrib modules to provide more scalable pattern choosers.
// hook_form_alter is too late in itself because all the possible parents are
// retrieved here, unless menu_override_parent_selector is set to TRUE.
if (variable_get('menu_override_parent_selector', FALSE)) {
// retrieved here, unless override_parent_selector is set to TRUE.
if (config('menu.settings')->get('override_parent_selector')) {
return array();
}