-
Notifications
You must be signed in to change notification settings - Fork 15
/
oe_content.install
39 lines (35 loc) · 1.14 KB
/
oe_content.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
<?php
/**
* @file
* The OpenEuropa Content installation file.
*/
declare(strict_types=1);
/**
* Implements hook_install().
*/
function oe_content_install($is_syncing) {
// Configure the RDF SKOS graphs.
if (!$is_syncing) {
\Drupal::service('oe_content.op_skos_setup')->setup();
}
}
/**
* Configuration base fields - the view is editable and its hidden by default.
*/
function oe_content_update_8001() {
// Remove base fields from display.
$base_fields = [
'oe_content_short_title',
'oe_content_navigation_title',
'oe_content_content_owner',
'oe_content_legacy_link',
];
/** @var \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface $entity_definition_update_manager */
$entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
foreach ($base_fields as $base_field) {
$field_definition = $entity_definition_update_manager->getFieldStorageDefinition($base_field, 'node');
$field_definition->setDisplayConfigurable('view', TRUE);
$field_definition->setDisplayOptions('view', []);
$entity_definition_update_manager->updateFieldStorageDefinition($field_definition);
}
}