Skip to content

Commit

Permalink
EWPP-1777: Move update of fields to their modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
yenyasinn committed May 13, 2022
1 parent 05e3e98 commit 32c812a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @file
* Post update functions for OpenEuropa Content Event Person reference module.
*/

declare(strict_types = 1);

use Drupal\field\Entity\FieldConfig;

/**
* Set "composite revisions" option for reference fields.
*/
function oe_content_event_person_reference_post_update_00001(): void {
$field_config = FieldConfig::load('oe_event_speaker.oe_default.oe_person');
$field_config->setThirdPartySetting('composite_reference', 'composite_revisions', FALSE);
$field_config->save();
}
1 change: 0 additions & 1 deletion modules/oe_content_event/oe_content_event.post_update.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ function oe_content_event_post_update_20004(): void {
'node.oe_event.oe_event_contact' => TRUE,
'node.oe_event.oe_event_media' => FALSE,
'node.oe_event.oe_event_venue' => TRUE,
'oe_event_speaker.oe_default.oe_person' => FALSE,
];
foreach ($fields as $field => $value) {
$field_config = FieldConfig::load($field);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @file
* Post update functions for OpenEuropa Organisation Person Reference module.
*/

declare(strict_types = 1);

use Drupal\field\Entity\FieldConfig;

/**
* Set "composite revisions" option for reference fields.
*/
function oe_content_organisation_person_reference_post_update_00001(): void {
$field_config = FieldConfig::load('node.oe_organisation.oe_organisation_persons');
$field_config->setThirdPartySetting('composite_reference', 'composite_revisions', FALSE);
$field_config->save();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* @file
* Post update functions for OpenEuropa Organisation Reference module.
*/

declare(strict_types = 1);

use Drupal\field\Entity\FieldConfig;

/**
* Set "composite revisions" option for reference fields.
*/
function oe_content_organisation_reference_post_update_00001(): void {
$field_config = FieldConfig::load('oe_contact.oe_organisation_reference.oe_node_reference');
$field_config->setThirdPartySetting('composite_reference', 'composite_revisions', FALSE);
$field_config->save();
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ function oe_content_organisation_post_update_20007(): void {
'node.oe_organisation.oe_organisation_chart' => FALSE,
'node.oe_organisation.oe_organisation_contact' => TRUE,
'node.oe_organisation.oe_organisation_logo' => FALSE,
'oe_contact.oe_organisation_reference.oe_node_reference' => FALSE,
];
foreach ($fields as $field => $value) {
$field_config = FieldConfig::load($field);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ function oe_content_publication_post_update_20002(): void {
* Set "composite revisions" option for reference fields.
*/
function oe_content_publication_post_update_20003(): void {
$field_config = FieldConfig::load('node.oe_publication.oe_publication_contacts');
$field_config->setThirdPartySetting('composite_reference', 'composite_revisions', TRUE);
$field_config->save();

$fields = [
'node.oe_publication.oe_publication_contacts' => TRUE,
'node.oe_publication.oe_publication_publications' => FALSE,
Expand Down

0 comments on commit 32c812a

Please sign in to comment.