You are here

function hierarchical_taxonomy_menu_update_8002 in Hierarchical Taxonomy Menu 8

Convert show_count config values from bool to integer.

File

./hierarchical_taxonomy_menu.install, line 30
Installation file for Hierarchical Taxonomy Menu module.

Code

function hierarchical_taxonomy_menu_update_8002() {
  $config_factory = \Drupal::configFactory();
  foreach ($config_factory
    ->listAll('block.block.hierarchicaltaxonomymenu') as $block_config_name) {
    $block = $config_factory
      ->getEditable($block_config_name);
    $settings = $block
      ->get('settings');
    $settings['show_count'] = (int) $settings['show_count'];
    $block
      ->set('settings', $settings);
    $block
      ->save();
  }
}