Split from #2102521: Finish converting menu.module to CMI.
Child of #1775842: [meta] Convert all variables to state and/or config systems

core/modules/menu/menu.module includes the following calls to the variable system, which will not be available in Drupal 8.

217 $active_menus = variable_get('menu_default_active_menus', array_keys(menu_get_menus()));
221 variable_set('menu_default_active_menus', $active_menus);

This variable has been partially migrated to system.menu.active_menus_default

Files: 
CommentFileSizeAuthor
#4 2106097-active-menus-default-4.patch1.53 KBianthomas_uk
PASSED: [[SimpleTest]]: [MySQL] 58,825 pass(es).
[ View ]
#4 2106097-1-4-interdiff.txt1.18 KBianthomas_uk
#1 2106097-active-menus-default-1.patch1.06 KBianthomas_uk
FAILED: [[SimpleTest]]: [MySQL] 58,803 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.06 KB
FAILED: [[SimpleTest]]: [MySQL] 58,803 pass(es), 1 fail(s), and 0 exception(s).
[ View ]

Looks good to me. Except a minor coding standard bug.

+++ b/core/modules/menu/menu.module
@@ -209,12 +209,15 @@ function menu_menu_predelete(Menu $menu) {
+    // Prevent the gap left by the removed menu from causing array indices to be saved

Minor: Comment exceeds 80 chars limit and missing period at the end.

btw, foreach-- :), so ianmthomasuk++

Also noted that the system_update_8033 trying to update the wrong variable name (i.e. 'active_menus_default'). Can you update system_update_8033 as well please? It should be:

/**
* Convert active_menus_default variable to config.
*
* @ingroup config_upgrade
*/
function system_update_8033() {
  update_variables_to_config('system.menu', array(
    'menu_default_active_menus' => 'active_menus_default'
  ));
}

StatusFileSize
new1.18 KB
new1.53 KB
PASSED: [[SimpleTest]]: [MySQL] 58,825 pass(es).
[ View ]

New patch addressing #2 and #3

Thanks @ianmthomasuk.

+1 from my side to RTBC.

Status:Needs review» Reviewed & tested by the community

Component:content_translation.module» menu.module

Wrong component?

Status:Reviewed & tested by the community» Fixed

Committed/pushed to 8.x, thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.