From c65291838c0c8dedaab45a482b02234c93435069 Mon Sep 17 00:00:00 2001 From: joegl <20383-joegl@users.noreply.drupalcode.org> Date: Mon, 24 Feb 2025 14:07:44 -0600 Subject: [PATCH] Database update; allow hs_private_page nodes to be exported via single_content_sync. --- .../su_humsci_profile/su_humsci_profile.install | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install index 7f26dc1e4..9598efb7e 100644 --- a/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install +++ b/docroot/profiles/humsci/su_humsci_profile/su_humsci_profile.install @@ -1263,3 +1263,18 @@ function su_humsci_profile_update_9723(&$sandbox) { $sandbox['#finished'] = count($sandbox['ids']) ? 1 - count($sandbox['ids']) / $sandbox['total'] : 1; } + +/** + * Allow hs_private_page nodes to be exported via single_content_sync. + */ +function su_humsci_profile_update_9724() { + $config_factory = \Drupal::configFactory(); + $config = $config_factory->getEditable('single_content_sync.settings'); + $allowed_entity_types = $config->get('allowed_entity_types.node'); + + array_push($allowed_entity_types, 'hs_private_page'); + asort($allowed_entity_types); + $allowed_entity_types = array_unique($allowed_entity_types); + + $config->set('allowed_entity_types.node', $allowed_entity_types)->save(); +}