-
Notifications
You must be signed in to change notification settings - Fork 26
/
islandora_defaults.install
46 lines (42 loc) · 1.15 KB
/
islandora_defaults.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
<?php
/**
* @file
* Install/update hook implementations.
*/
/**
* Replaces source.keys with source.ids.
*/
function islandora_defaults_update_8001() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('migrate_plus.migration.islandora_defaults_tags');
if ($config) {
if (!$config->get('source.ids')) {
$config->set('source.ids', $config->get('source.keys'));
$config->clear('source.keys');
$config->save(TRUE);
}
}
}
/**
* Changes migration_tags to an array.
*/
function islandora_defaults_update_8002() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('migrate_plus.migration.islandora_defaults_tags');
if ($config) {
if (!is_array($config->get('migration_tags'))) {
$config->set('migration_tags', [$config->get('migration_tags')]);
$config->save(TRUE);
}
}
}
/**
* Deletes the context for indexing in Gemini.
*/
function islandora_defaults_update_8003() {
$config_factory = \Drupal::configFactory();
$context = $config_factory->getEditable('context.context.files_in_fedora');
if ($context) {
$context->delete();
}
}