-
Notifications
You must be signed in to change notification settings - Fork 0
/
hierarchical_taxonomy_menu.install
42 lines (33 loc) · 1.18 KB
/
hierarchical_taxonomy_menu.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @file
* Installation file for Hierarchical Taxonomy Menu module.
*/
/**
* Convert config values.
*/
function hierarchical_taxonomy_menu_update_8001() {
$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['collapsible'] = (bool) $settings['collapsible'];
$settings['interactive_parent'] = (bool) $settings['interactive_parent'];
$settings['dynamic_base_term'] = (bool) $settings['dynamic_base_term'];
$block->set('settings', $settings);
$block->save();
}
}
/**
* Convert show_count config values from bool to integer.
*/
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();
}
}