diff --git a/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_call_proposals_contact.yml b/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_call_proposals_contact.yml index 3c9be555e..3d46e40f2 100644 --- a/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_call_proposals_contact.yml +++ b/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_call_proposals_contact.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_call_proposals.oe_call_proposals_contact field_name: oe_call_proposals_contact entity_type: node diff --git a/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_documents.yml b/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_documents.yml index 37ca0c799..2877947de 100644 --- a/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_documents.yml +++ b/modules/oe_content_call_proposals/config/install/field.field.node.oe_call_proposals.oe_documents.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_call_proposals.oe_documents field_name: oe_documents entity_type: node diff --git a/modules/oe_content_call_proposals/oe_content_call_proposals.post_update.php b/modules/oe_content_call_proposals/oe_content_call_proposals.post_update.php index a0ee6205e..c3b28b157 100644 --- a/modules/oe_content_call_proposals/oe_content_call_proposals.post_update.php +++ b/modules/oe_content_call_proposals/oe_content_call_proposals.post_update.php @@ -8,6 +8,7 @@ declare(strict_types = 1); use Drupal\Core\Entity\Entity\EntityFormDisplay; +use Drupal\field\Entity\FieldConfig; /** * Set inline entity form widgets reference removal policy to keep entities. @@ -18,3 +19,18 @@ function oe_content_call_proposals_post_update_00001(): void { $component['settings']['removed_reference'] = 'keep'; $form_display->setComponent('oe_call_proposals_contact', $component)->save(); } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_call_proposals_post_update_00002(): void { + $fields = [ + 'node.oe_call_proposals.oe_call_proposals_contact' => TRUE, + 'node.oe_call_proposals.oe_documents' => FALSE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_call_tenders/config/install/field.field.node.oe_call_tenders.oe_documents.yml b/modules/oe_content_call_tenders/config/install/field.field.node.oe_call_tenders.oe_documents.yml index 13f571ebc..717e741c8 100644 --- a/modules/oe_content_call_tenders/config/install/field.field.node.oe_call_tenders.oe_documents.yml +++ b/modules/oe_content_call_tenders/config/install/field.field.node.oe_call_tenders.oe_documents.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_call_tenders.oe_documents field_name: oe_documents entity_type: node diff --git a/modules/oe_content_call_tenders/oe_content_call_tenders.post_update.php b/modules/oe_content_call_tenders/oe_content_call_tenders.post_update.php index 51a882682..7887f9be9 100644 --- a/modules/oe_content_call_tenders/oe_content_call_tenders.post_update.php +++ b/modules/oe_content_call_tenders/oe_content_call_tenders.post_update.php @@ -8,6 +8,7 @@ declare(strict_types = 1); use Drupal\Core\Config\FileStorage; +use Drupal\field\Entity\FieldConfig; /** * Add maxlegnth to oe_content_short_title, oe_summary, oe_teaser, title. @@ -26,3 +27,12 @@ function oe_content_call_tenders_post_update_00001() { $form_display->save(); } } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_call_tenders_post_update_00002(): void { + $field_config = FieldConfig::load('node.oe_call_tenders.oe_documents'); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', FALSE); + $field_config->save(); +} diff --git a/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_contacts.yml b/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_contacts.yml index cd91563f7..fe126f88c 100644 --- a/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_contacts.yml +++ b/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_contacts.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_consultation.oe_consultation_contacts field_name: oe_consultation_contacts entity_type: node diff --git a/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_documents.yml b/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_documents.yml index dca140fc4..2e1fe1c04 100644 --- a/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_documents.yml +++ b/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_documents.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_consultation.oe_consultation_documents field_name: oe_consultation_documents entity_type: node diff --git a/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_outcome_files.yml b/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_outcome_files.yml index 81d19ed8a..ec84ab20e 100644 --- a/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_outcome_files.yml +++ b/modules/oe_content_consultation/config/install/field.field.node.oe_consultation.oe_consultation_outcome_files.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_consultation.oe_consultation_outcome_files field_name: oe_consultation_outcome_files entity_type: node diff --git a/modules/oe_content_consultation/oe_content_consultation.post_update.php b/modules/oe_content_consultation/oe_content_consultation.post_update.php new file mode 100644 index 000000000..bbc035fec --- /dev/null +++ b/modules/oe_content_consultation/oe_content_consultation.post_update.php @@ -0,0 +1,26 @@ + TRUE, + 'node.oe_consultation.oe_consultation_documents' => TRUE, + 'node.oe_consultation.oe_consultation_outcome_files' => FALSE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_contact.yml b/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_contact.yml index 40b0e5d0c..db7dc3c38 100644 --- a/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_contact.yml +++ b/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_contact.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_event.oe_event_contact field_name: oe_event_contact entity_type: node diff --git a/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_media.yml b/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_media.yml index b1bc0134d..209742f7a 100644 --- a/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_media.yml +++ b/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_media.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_event.oe_event_media field_name: oe_event_media entity_type: node diff --git a/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_venue.yml b/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_venue.yml index e210f2987..50ef90474 100644 --- a/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_venue.yml +++ b/modules/oe_content_event/config/install/field.field.node.oe_event.oe_event_venue.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_event.oe_event_venue field_name: oe_event_venue entity_type: node diff --git a/modules/oe_content_event/modules/oe_content_event_person_reference/config/install/field.field.oe_event_speaker.oe_default.oe_person.yml b/modules/oe_content_event/modules/oe_content_event_person_reference/config/install/field.field.oe_event_speaker.oe_default.oe_person.yml index 401ef1ffd..1b58835a8 100644 --- a/modules/oe_content_event/modules/oe_content_event_person_reference/config/install/field.field.oe_event_speaker.oe_default.oe_person.yml +++ b/modules/oe_content_event/modules/oe_content_event_person_reference/config/install/field.field.oe_event_speaker.oe_default.oe_person.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: oe_event_speaker.oe_default.oe_person field_name: oe_person entity_type: oe_event_speaker diff --git a/modules/oe_content_event/modules/oe_content_event_person_reference/oe_content_event_person_reference.post_update.php b/modules/oe_content_event/modules/oe_content_event_person_reference/oe_content_event_person_reference.post_update.php new file mode 100644 index 000000000..ebda6aef3 --- /dev/null +++ b/modules/oe_content_event/modules/oe_content_event_person_reference/oe_content_event_person_reference.post_update.php @@ -0,0 +1,19 @@ +setThirdPartySetting('composite_reference', 'composite_revisions', FALSE); + $field_config->save(); +} diff --git a/modules/oe_content_event/oe_content_event.post_update.php b/modules/oe_content_event/oe_content_event.post_update.php index cf23a4b42..e88af241a 100644 --- a/modules/oe_content_event/oe_content_event.post_update.php +++ b/modules/oe_content_event/oe_content_event.post_update.php @@ -133,3 +133,19 @@ function oe_content_event_post_update_20003(): void { $field_config->setSetting('title', 2); $field_config->save(); } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_event_post_update_20004(): void { + $fields = [ + 'node.oe_event.oe_event_contact' => TRUE, + 'node.oe_event.oe_event_media' => FALSE, + 'node.oe_event.oe_event_venue' => TRUE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_news/config/install/field.field.node.oe_news.oe_news_contacts.yml b/modules/oe_content_news/config/install/field.field.node.oe_news.oe_news_contacts.yml index b1de6683f..17d05fd80 100644 --- a/modules/oe_content_news/config/install/field.field.node.oe_news.oe_news_contacts.yml +++ b/modules/oe_content_news/config/install/field.field.node.oe_news.oe_news_contacts.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_news.oe_news_contacts field_name: oe_news_contacts entity_type: node diff --git a/modules/oe_content_news/oe_content_news.post_update.php b/modules/oe_content_news/oe_content_news.post_update.php index ddafffeca..06f7a980e 100644 --- a/modules/oe_content_news/oe_content_news.post_update.php +++ b/modules/oe_content_news/oe_content_news.post_update.php @@ -131,3 +131,12 @@ function oe_content_news_post_update_20009(): void { $updated_form_display->save(); } } + +/** + * Enable "composite revisions" option for "Contacts" field. + */ +function oe_content_news_post_update_20010(): void { + $field_config = FieldConfig::load('node.oe_news.oe_news_contacts'); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', TRUE); + $field_config->save(); +} diff --git a/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_chart.yml b/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_chart.yml index a7a20dc3b..60b0fa80c 100644 --- a/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_chart.yml +++ b/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_chart.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_organisation.oe_organisation_chart field_name: oe_organisation_chart entity_type: node diff --git a/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_contact.yml b/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_contact.yml index 92cfdc699..f29b47db3 100644 --- a/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_contact.yml +++ b/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_contact.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_organisation.oe_organisation_contact field_name: oe_organisation_contact entity_type: node diff --git a/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_logo.yml b/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_logo.yml index 61a64fee8..05fef9941 100644 --- a/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_logo.yml +++ b/modules/oe_content_organisation/config/install/field.field.node.oe_organisation.oe_organisation_logo.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_organisation.oe_organisation_logo field_name: oe_organisation_logo entity_type: node diff --git a/modules/oe_content_organisation/modules/oe_content_organisation_person_reference/config/install/field.field.node.oe_organisation.oe_organisation_persons.yml b/modules/oe_content_organisation/modules/oe_content_organisation_person_reference/config/install/field.field.node.oe_organisation.oe_organisation_persons.yml index 3337f0f70..4f9dfef37 100644 --- a/modules/oe_content_organisation/modules/oe_content_organisation_person_reference/config/install/field.field.node.oe_organisation.oe_organisation_persons.yml +++ b/modules/oe_content_organisation/modules/oe_content_organisation_person_reference/config/install/field.field.node.oe_organisation.oe_organisation_persons.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_organisation.oe_organisation_persons field_name: oe_organisation_persons entity_type: node diff --git a/modules/oe_content_organisation/modules/oe_content_organisation_person_reference/oe_content_organisation_person_reference.post_update.php b/modules/oe_content_organisation/modules/oe_content_organisation_person_reference/oe_content_organisation_person_reference.post_update.php new file mode 100644 index 000000000..09df83a68 --- /dev/null +++ b/modules/oe_content_organisation/modules/oe_content_organisation_person_reference/oe_content_organisation_person_reference.post_update.php @@ -0,0 +1,19 @@ +setThirdPartySetting('composite_reference', 'composite_revisions', FALSE); + $field_config->save(); +} diff --git a/modules/oe_content_organisation/modules/oe_content_organisation_reference/config/install/field.field.oe_contact.oe_organisation_reference.oe_node_reference.yml b/modules/oe_content_organisation/modules/oe_content_organisation_reference/config/install/field.field.oe_contact.oe_organisation_reference.oe_node_reference.yml index ec4036e1a..24cdc1ea4 100644 --- a/modules/oe_content_organisation/modules/oe_content_organisation_reference/config/install/field.field.oe_contact.oe_organisation_reference.oe_node_reference.yml +++ b/modules/oe_content_organisation/modules/oe_content_organisation_reference/config/install/field.field.oe_contact.oe_organisation_reference.oe_node_reference.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: oe_contact.oe_organisation_reference.oe_node_reference field_name: oe_node_reference entity_type: oe_contact diff --git a/modules/oe_content_organisation/modules/oe_content_organisation_reference/oe_content_organisation_reference.post_update.php b/modules/oe_content_organisation/modules/oe_content_organisation_reference/oe_content_organisation_reference.post_update.php new file mode 100644 index 000000000..afe2b47ba --- /dev/null +++ b/modules/oe_content_organisation/modules/oe_content_organisation_reference/oe_content_organisation_reference.post_update.php @@ -0,0 +1,19 @@ +setThirdPartySetting('composite_reference', 'composite_revisions', FALSE); + $field_config->save(); +} diff --git a/modules/oe_content_organisation/oe_content_organisation.post_update.php b/modules/oe_content_organisation/oe_content_organisation.post_update.php index 533c24562..5e976d2c3 100644 --- a/modules/oe_content_organisation/oe_content_organisation.post_update.php +++ b/modules/oe_content_organisation/oe_content_organisation.post_update.php @@ -95,3 +95,19 @@ function oe_content_organisation_post_update_20006() { $updated_form_display->save(); } } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_organisation_post_update_20007(): void { + $fields = [ + 'node.oe_organisation.oe_organisation_chart' => FALSE, + 'node.oe_organisation.oe_organisation_contact' => TRUE, + 'node.oe_organisation.oe_organisation_logo' => FALSE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_contacts.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_contacts.yml index 580f9e652..b04761bd6 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_contacts.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_contacts.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_person.oe_person_contacts field_name: oe_person_contacts entity_type: node diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_cv.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_cv.yml index ea4efb98c..25350f225 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_cv.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_cv.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_person.oe_person_cv field_name: oe_person_cv entity_type: node diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_documents.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_documents.yml index 28800ed13..3fbefd124 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_documents.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_documents.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_person.oe_person_documents field_name: oe_person_documents entity_type: node diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_interests_file.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_interests_file.yml index 0f1d20799..545b058db 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_interests_file.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_interests_file.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_person.oe_person_interests_file field_name: oe_person_interests_file entity_type: node diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_jobs.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_jobs.yml index a7d492c51..2f7582f4c 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_jobs.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_jobs.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_person.oe_person_jobs field_name: oe_person_jobs entity_type: node diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_media.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_media.yml index f7f8a82ad..d9c479d96 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_media.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_media.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_person.oe_person_media field_name: oe_person_media entity_type: node diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_organisation.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_organisation.yml index ffbd95c4f..bfdc0b8f6 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_organisation.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_organisation.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_person.oe_person_organisation field_name: oe_person_organisation entity_type: node diff --git a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_photo.yml b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_photo.yml index 8379a4771..647cebb2e 100644 --- a/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_photo.yml +++ b/modules/oe_content_person/config/install/field.field.node.oe_person.oe_person_photo.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_person.oe_person_photo field_name: oe_person_photo entity_type: node diff --git a/modules/oe_content_person/oe_content_person.post_update.php b/modules/oe_content_person/oe_content_person.post_update.php index bd41b8e6a..c1acc3f37 100644 --- a/modules/oe_content_person/oe_content_person.post_update.php +++ b/modules/oe_content_person/oe_content_person.post_update.php @@ -8,6 +8,7 @@ declare(strict_types = 1); use Drupal\Core\Config\FileStorage; +use Drupal\field\Entity\FieldConfig; /** * Add length restrictions for title display fields. @@ -50,3 +51,24 @@ function oe_content_person_post_update_20002(): void { $field_storage->set('settings', $settings); $field_storage->save(); } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_person_post_update_20003(): void { + $fields = [ + 'node.oe_person.oe_person_contacts' => TRUE, + 'node.oe_person.oe_person_cv' => FALSE, + 'node.oe_person.oe_person_documents' => TRUE, + 'node.oe_person.oe_person_interests_file' => FALSE, + 'node.oe_person.oe_person_jobs' => TRUE, + 'node.oe_person.oe_person_media' => FALSE, + 'node.oe_person.oe_person_organisation' => FALSE, + 'node.oe_person.oe_person_photo' => FALSE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_documents.yml b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_documents.yml index b572fc2e2..bacf4c287 100644 --- a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_documents.yml +++ b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_documents.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_project.oe_documents field_name: oe_documents entity_type: node diff --git a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_contact.yml b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_contact.yml index 302c32df1..4312cff16 100644 --- a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_contact.yml +++ b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_contact.yml @@ -12,6 +12,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_project.oe_project_contact field_name: oe_project_contact entity_type: node diff --git a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_coordinators.yml b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_coordinators.yml index 397a11ca7..09d026afc 100644 --- a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_coordinators.yml +++ b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_coordinators.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_project.oe_project_coordinators field_name: oe_project_coordinators entity_type: node diff --git a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_participants.yml b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_participants.yml index e3f9797a0..3cc93b3e6 100644 --- a/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_participants.yml +++ b/modules/oe_content_project/config/install/field.field.node.oe_project.oe_project_participants.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_project.oe_project_participants field_name: oe_project_participants entity_type: node diff --git a/modules/oe_content_project/oe_content_project.post_update.php b/modules/oe_content_project/oe_content_project.post_update.php index aa9f0c6b3..e0a8b10dc 100644 --- a/modules/oe_content_project/oe_content_project.post_update.php +++ b/modules/oe_content_project/oe_content_project.post_update.php @@ -8,6 +8,7 @@ declare(strict_types = 1); use Drupal\Core\Entity\Entity\EntityFormDisplay; +use Drupal\field\Entity\FieldConfig; /** * Set inline entity form widget reference removal policy to keep entities. @@ -29,3 +30,20 @@ function oe_content_project_post_update_00001(): void { $form_display->save(); } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_project_post_update_00002(): void { + $fields = [ + 'node.oe_project.oe_documents' => FALSE, + 'node.oe_project.oe_project_contact' => TRUE, + 'node.oe_project.oe_project_coordinators' => TRUE, + 'node.oe_project.oe_project_participants' => TRUE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_contacts.yml b/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_contacts.yml index 2198f6aa6..ef241e408 100644 --- a/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_contacts.yml +++ b/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_contacts.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_publication.oe_publication_contacts field_name: oe_publication_contacts entity_type: node diff --git a/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_publications.yml b/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_publications.yml index b6ae0f718..d2038456c 100644 --- a/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_publications.yml +++ b/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_publications.yml @@ -9,6 +9,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_publication.oe_publication_publications field_name: oe_publication_publications entity_type: node diff --git a/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_thumbnail.yml b/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_thumbnail.yml index 1ce8ececb..02e5a2fde 100644 --- a/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_thumbnail.yml +++ b/modules/oe_content_publication/config/install/field.field.node.oe_publication.oe_publication_thumbnail.yml @@ -11,6 +11,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: node.oe_publication.oe_publication_thumbnail field_name: oe_publication_thumbnail entity_type: node diff --git a/modules/oe_content_publication/oe_content_publication.post_update.php b/modules/oe_content_publication/oe_content_publication.post_update.php index 8104da5cf..e993279f5 100644 --- a/modules/oe_content_publication/oe_content_publication.post_update.php +++ b/modules/oe_content_publication/oe_content_publication.post_update.php @@ -209,3 +209,19 @@ function oe_content_publication_post_update_20002(): void { $field_config->setRequired(FALSE); $field_config->save(); } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_publication_post_update_20003(): void { + $fields = [ + 'node.oe_publication.oe_publication_contacts' => TRUE, + 'node.oe_publication.oe_publication_publications' => FALSE, + 'node.oe_publication.oe_publication_thumbnail' => FALSE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_organisation.oe_node_reference.yml b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_organisation.oe_node_reference.yml index 9a6a722e9..3101475db 100644 --- a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_organisation.oe_node_reference.yml +++ b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_organisation.oe_node_reference.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: oe_author.oe_organisation.oe_node_reference field_name: oe_node_reference entity_type: oe_author diff --git a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_person.oe_node_reference.yml b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_person.oe_node_reference.yml index dffed2c4a..5999659db 100644 --- a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_person.oe_node_reference.yml +++ b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/config/install/field.field.oe_author.oe_person.oe_node_reference.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: oe_author.oe_person.oe_node_reference field_name: oe_node_reference entity_type: oe_author diff --git a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/oe_content_sub_entity_author.post_update.php b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/oe_content_sub_entity_author.post_update.php new file mode 100644 index 000000000..9b689967f --- /dev/null +++ b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/oe_content_sub_entity_author.post_update.php @@ -0,0 +1,25 @@ + FALSE, + 'oe_author.oe_person.oe_node_reference' => FALSE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +} diff --git a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/tests/modules/oe_content_sub_entity_author_test/config/install/field.field.node.oe_page.oe_authors.yml b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/tests/modules/oe_content_sub_entity_author_test/config/install/field.field.node.oe_page.oe_authors.yml index 4bd765283..187e09321 100644 --- a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/tests/modules/oe_content_sub_entity_author_test/config/install/field.field.node.oe_page.oe_authors.yml +++ b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_author/tests/modules/oe_content_sub_entity_author_test/config/install/field.field.node.oe_page.oe_authors.yml @@ -14,6 +14,7 @@ dependencies: third_party_settings: composite_reference: composite: true + composite_revisions: true id: node.oe_page.oe_authors field_name: oe_authors entity_type: node diff --git a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_document.oe_document.yml b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_document.oe_document.yml index 732669968..bb3b288fa 100644 --- a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_document.oe_document.yml +++ b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_document.oe_document.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: oe_document_reference.oe_document.oe_document field_name: oe_document entity_type: oe_document_reference diff --git a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_publication.oe_publication.yml b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_publication.oe_publication.yml index a2b2315d7..b422aec56 100644 --- a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_publication.oe_publication.yml +++ b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/config/install/field.field.oe_document_reference.oe_publication.oe_publication.yml @@ -10,6 +10,7 @@ dependencies: third_party_settings: composite_reference: composite: false + composite_revisions: false id: oe_document_reference.oe_publication.oe_publication field_name: oe_publication entity_type: oe_document_reference diff --git a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/oe_content_sub_entity_document_reference.post_update.php b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/oe_content_sub_entity_document_reference.post_update.php index de21907e2..83c285a05 100644 --- a/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/oe_content_sub_entity_document_reference.post_update.php +++ b/modules/oe_content_sub_entity/modules/oe_content_sub_entity_document_reference/oe_content_sub_entity_document_reference.post_update.php @@ -8,6 +8,7 @@ declare(strict_types = 1); use Drupal\Core\Config\FileStorage; +use Drupal\field\Entity\FieldConfig; /** * Hide untranslatable fields for all bundles. @@ -37,3 +38,18 @@ function oe_content_sub_entity_document_reference_post_update_00001() { } } + +/** + * Set "composite revisions" option for reference fields. + */ +function oe_content_sub_entity_document_reference_post_update_00002(): void { + $fields = [ + 'oe_document_reference.oe_document.oe_document' => FALSE, + 'oe_document_reference.oe_publication.oe_publication' => FALSE, + ]; + foreach ($fields as $field => $value) { + $field_config = FieldConfig::load($field); + $field_config->setThirdPartySetting('composite_reference', 'composite_revisions', $value); + $field_config->save(); + } +}