-
Notifications
You must be signed in to change notification settings - Fork 0
/
os2web_meetings_agman.install
45 lines (36 loc) · 1.43 KB
/
os2web_meetings_agman.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
43
44
45
<?php
/**
* @file
* Install, uninstall and update hooks for page builder module.
*/
use Drupal\os2web_meetings\Form\SettingsForm;
use Symfony\Component\Yaml\Yaml;
/**
* Setting empty BPA title as Beskrivelse.
*/
function os2web_meetings_agman_update_8001() {
$config = \Drupal::service('config.factory')->getEditable(SettingsForm::$configName);
// Renaming config value.
$config->set('agman_meetings_import_empty_bpa_title', 'Beskrivelse');
$config->save();
}
/**
* Updating migration.
*/
function os2web_meetings_agman_update_8002() {
$config_name = 'migrate_plus.migration.os2web_meetings_agman_import';
$path = drupal_get_path('module', 'os2web_meetings_agman');
/** @var \Drupal\Core\Config\StorageInterface $active_storage */
$active_storage = \Drupal::service('config.storage');
$active_storage->write($config_name, Yaml::parse(file_get_contents($path . '/config/install/' . $config_name . '.yml')));
}
/**
* Updating migration - adjusting meeting dates timezone.
*/
function os2web_meetings_agman_update_8003() {
$config_name = 'migrate_plus.migration.os2web_meetings_agman_import';
$path = \Drupal::service('extension.list.module')->getPath('os2web_meetings_agman');
/** @var \Drupal\Core\Config\StorageInterface $active_storage */
$active_storage = \Drupal::service('config.storage');
$active_storage->write($config_name, Yaml::parse(file_get_contents($path . '/config/install/' . $config_name . '.yml')));
}