Commit 8134fec4 authored by webchick's avatar webchick

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

parent f95db7d4
......@@ -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.
......
main_links: main
secondary_links: account
override_parent_selector: '0'
......@@ -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',
));
}
......@@ -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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment