Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
8134fec4
Commit
8134fec4
authored
Dec 29, 2012
by
webchick
Browse files
Issue
#1830936
by mtunay, vijaycs85: Convert the 'menu_override_parent_selector()' variable to CMI.
parent
f95db7d4
Changes
4
Show whitespace changes
Inline
Side-by-side
core/modules/book/book.module
View file @
8134fec4
...
...
@@ -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.
...
...
core/modules/menu/config/menu.settings.yml
View file @
8134fec4
main_links
:
main
secondary_links
:
account
override_parent_selector
:
'
0'
core/modules/menu/menu.install
View file @
8134fec4
...
...
@@ -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'
,
));
}
core/modules/menu/menu.module
View file @
8134fec4
...
...
@@ -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
();
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment