-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathezcontent.install
48 lines (43 loc) · 1.56 KB
/
ezcontent.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
46
47
48
<?php
/**
* @file
* Install, update/uninstall functions for the EZ Content profile.
*/
/**
* Configuration changes post update of field group module to 3.x.
*/
function ezcontent_update_8001() {
/** @var \Drupal\update_helper\Updater $updateHelper */
$updateHelper = \Drupal::service('update_helper.updater');
// Execute configuration update definitions with logging of success.
$updateHelper->executeUpdate('ezcontent', 'ezcontent_update_8001');
// Output logged messages to related channel of update execution.
return $updateHelper->logger()->output();
}
/**
* Configuration changes for update from 1.2 to 1.3.
*/
function ezcontent_update_8002() {
// Remove module entries from core.extension config for modules that are no
// longer part of ezcontent profile.
$module_data = \Drupal::config('core.extension')->get('module');
unset($module_data['default_content'], $module_data['ezcontent_demo'], $module_data['moderation_note']);
\Drupal::configFactory()->getEditable('core.extension')
->set('module', $module_data)
->save();
// Remove module entries from key_value table for modules that are no longer
// part of ezcontent profile.
$modules = [
'default_content',
'ezcontent_demo',
'moderation_note',
];
\Drupal::database()->delete('key_value')
->condition('collection', 'system.schema')
->condition('name', $modules, 'IN')
->execute();
// Install gin theme.
\Drupal::service('theme_installer')->install(['gin']);
// Install gin toolbar.
\Drupal::service('module_installer')->install(['gin_toolbar']);
}