1 menu.install menu_update_1000()

Moves menu settings from variables to config.

Related topics

File

core/modules/menu/menu.install, line 55
Install, update and uninstall functions for the menu module.

Code

function menu_update_1000() {
  // Migrate variables to config.
  $config = config('menu.settings');
  $config->set('menu_main_links', update_variable_get('menu_main_links_source', 'main-menu'));
  $config->set('menu_secondary_links_source', update_variable_get('menu_main_links_source', 'user-menu'));
  $config->save();

  // Delete variables.
  update_variable_del('menu_main_links_source');
  update_variable_del('menu_secondary_links_source');
}