From fb3bdf624ee7ccf7b0478be07dd996ed7c7a7dd7 Mon Sep 17 00:00:00 2001 From: Md Nadim Hossain Date: Thu, 22 Feb 2024 17:51:14 +1100 Subject: [PATCH] Added update hook to add new component that was missed during the d10 update. (#72) * Added update hook to add new component that was missed during the d10 update. * Added missing dependency to content collection which was breaking the build and test. --- composer.json | 1 + ...splay.node.tide_search_listing.default.yml | 1 + ...aragraph.listing_custom_filter.default.yml | 2 ++ ...aph.listing_user_custom_filter.default.yml | 2 ++ ...earch_listing_header_component.default.yml | 1 + ...splay.node.tide_search_listing.default.yml | 1 + ...aragraph.listing_custom_filter.default.yml | 2 ++ ...aph.listing_user_custom_filter.default.yml | 2 ++ ...earch_listing_header_component.default.yml | 2 ++ ...isting.field_custom_sort_configuration.yml | 2 ++ ...rch_listing.field_listing_query_config.yml | 2 ++ ...h_listing.field_listing_results_config.yml | 2 ++ ...rch_listing.field_search_configuration.yml | 2 ++ ...ilter.field_listing_custom_filter_conf.yml | 2 ++ ...filter.field_user_filter_configuration.yml | 2 ++ ...r_component.field_header_configuration.yml | 2 ++ ...e.node.field_custom_sort_configuration.yml | 1 + ...torage.node.field_listing_query_config.yml | 1 + ...rage.node.field_listing_results_config.yml | 1 + ...torage.node.field_search_configuration.yml | 1 + ...e.paragraph.field_header_configuration.yml | 1 + ...graph.field_listing_custom_filter_conf.yml | 1 + ...agraph.field_user_filter_configuration.yml | 1 + tide_search.info.yml | 2 ++ tide_search.install | 32 +++++++++++++++++++ 25 files changed, 69 insertions(+) diff --git a/composer.json b/composer.json index d0490ca..91d860b 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ } }, "require": { + "dpc-sdp/tide_api": "^4.0.0", "dpc-sdp/tide_core": "^4.0.0", "dpc-sdp/tide_landing_page": "^4.0.0", "drupal/elasticsearch_connector": "^7.0", diff --git a/config/optional/core.entity_form_display.node.tide_search_listing.default.yml b/config/optional/core.entity_form_display.node.tide_search_listing.default.yml index 7bbbaf1..748f626 100644 --- a/config/optional/core.entity_form_display.node.tide_search_listing.default.yml +++ b/config/optional/core.entity_form_display.node.tide_search_listing.default.yml @@ -35,6 +35,7 @@ dependencies: - path - select2 - text + - tide_content_collection third_party_settings: field_group: group_search_listing_header: diff --git a/config/optional/core.entity_form_display.paragraph.listing_custom_filter.default.yml b/config/optional/core.entity_form_display.paragraph.listing_custom_filter.default.yml index 19d8b59..62308f1 100644 --- a/config/optional/core.entity_form_display.paragraph.listing_custom_filter.default.yml +++ b/config/optional/core.entity_form_display.paragraph.listing_custom_filter.default.yml @@ -4,6 +4,8 @@ dependencies: config: - field.field.paragraph.listing_custom_filter.field_listing_custom_filter_conf - paragraphs.paragraphs_type.listing_custom_filter + module: + - tide_content_collection id: paragraph.listing_custom_filter.default targetEntityType: paragraph bundle: listing_custom_filter diff --git a/config/optional/core.entity_form_display.paragraph.listing_user_custom_filter.default.yml b/config/optional/core.entity_form_display.paragraph.listing_user_custom_filter.default.yml index 6dd5b9b..d9cff7a 100644 --- a/config/optional/core.entity_form_display.paragraph.listing_user_custom_filter.default.yml +++ b/config/optional/core.entity_form_display.paragraph.listing_user_custom_filter.default.yml @@ -4,6 +4,8 @@ dependencies: config: - field.field.paragraph.listing_user_custom_filter.field_user_filter_configuration - paragraphs.paragraphs_type.listing_user_custom_filter + module: + - tide_content_collection id: paragraph.listing_user_custom_filter.default targetEntityType: paragraph bundle: listing_user_custom_filter diff --git a/config/optional/core.entity_form_display.paragraph.search_listing_header_component.default.yml b/config/optional/core.entity_form_display.paragraph.search_listing_header_component.default.yml index 10c2a7f..4cdfee2 100644 --- a/config/optional/core.entity_form_display.paragraph.search_listing_header_component.default.yml +++ b/config/optional/core.entity_form_display.paragraph.search_listing_header_component.default.yml @@ -7,6 +7,7 @@ dependencies: - paragraphs.paragraphs_type.search_listing_header_component module: - select2 + - tide_content_collection id: paragraph.search_listing_header_component.default targetEntityType: paragraph bundle: search_listing_header_component diff --git a/config/optional/core.entity_view_display.node.tide_search_listing.default.yml b/config/optional/core.entity_view_display.node.tide_search_listing.default.yml index 40daaa6..6f999d8 100644 --- a/config/optional/core.entity_view_display.node.tide_search_listing.default.yml +++ b/config/optional/core.entity_view_display.node.tide_search_listing.default.yml @@ -30,6 +30,7 @@ dependencies: - entity_reference_revisions - metatag - text + - tide_content_collection - user id: node.tide_search_listing.default targetEntityType: node diff --git a/config/optional/core.entity_view_display.paragraph.listing_custom_filter.default.yml b/config/optional/core.entity_view_display.paragraph.listing_custom_filter.default.yml index 7257063..8d61916 100644 --- a/config/optional/core.entity_view_display.paragraph.listing_custom_filter.default.yml +++ b/config/optional/core.entity_view_display.paragraph.listing_custom_filter.default.yml @@ -4,6 +4,8 @@ dependencies: config: - field.field.paragraph.listing_custom_filter.field_listing_custom_filter_conf - paragraphs.paragraphs_type.listing_custom_filter + module: + - tide_content_collection id: paragraph.listing_custom_filter.default targetEntityType: paragraph bundle: listing_custom_filter diff --git a/config/optional/core.entity_view_display.paragraph.listing_user_custom_filter.default.yml b/config/optional/core.entity_view_display.paragraph.listing_user_custom_filter.default.yml index 6b0dddf..d6ef17d 100644 --- a/config/optional/core.entity_view_display.paragraph.listing_user_custom_filter.default.yml +++ b/config/optional/core.entity_view_display.paragraph.listing_user_custom_filter.default.yml @@ -4,6 +4,8 @@ dependencies: config: - field.field.paragraph.listing_user_custom_filter.field_user_filter_configuration - paragraphs.paragraphs_type.listing_user_custom_filter + module: + - tide_content_collection id: paragraph.listing_user_custom_filter.default targetEntityType: paragraph bundle: listing_user_custom_filter diff --git a/config/optional/core.entity_view_display.paragraph.search_listing_header_component.default.yml b/config/optional/core.entity_view_display.paragraph.search_listing_header_component.default.yml index 0155a06..f3f3ca0 100644 --- a/config/optional/core.entity_view_display.paragraph.search_listing_header_component.default.yml +++ b/config/optional/core.entity_view_display.paragraph.search_listing_header_component.default.yml @@ -5,6 +5,8 @@ dependencies: - field.field.paragraph.search_listing_header_component.field_component - field.field.paragraph.search_listing_header_component.field_header_configuration - paragraphs.paragraphs_type.search_listing_header_component + module: + - tide_content_collection id: paragraph.search_listing_header_component.default targetEntityType: paragraph bundle: search_listing_header_component diff --git a/config/optional/field.field.node.tide_search_listing.field_custom_sort_configuration.yml b/config/optional/field.field.node.tide_search_listing.field_custom_sort_configuration.yml index 7a42159..05ca05e 100644 --- a/config/optional/field.field.node.tide_search_listing.field_custom_sort_configuration.yml +++ b/config/optional/field.field.node.tide_search_listing.field_custom_sort_configuration.yml @@ -4,6 +4,8 @@ dependencies: config: - field.storage.node.field_custom_sort_configuration - node.type.tide_search_listing + module: + - tide_content_collection id: node.tide_search_listing.field_custom_sort_configuration field_name: field_custom_sort_configuration entity_type: node diff --git a/config/optional/field.field.node.tide_search_listing.field_listing_query_config.yml b/config/optional/field.field.node.tide_search_listing.field_listing_query_config.yml index 20284a7..375f8cd 100644 --- a/config/optional/field.field.node.tide_search_listing.field_listing_query_config.yml +++ b/config/optional/field.field.node.tide_search_listing.field_listing_query_config.yml @@ -4,6 +4,8 @@ dependencies: config: - field.storage.node.field_listing_query_config - node.type.tide_search_listing + module: + - tide_content_collection id: node.tide_search_listing.field_listing_query_config field_name: field_listing_query_config entity_type: node diff --git a/config/optional/field.field.node.tide_search_listing.field_listing_results_config.yml b/config/optional/field.field.node.tide_search_listing.field_listing_results_config.yml index e12da72..9a5bc8d 100644 --- a/config/optional/field.field.node.tide_search_listing.field_listing_results_config.yml +++ b/config/optional/field.field.node.tide_search_listing.field_listing_results_config.yml @@ -4,6 +4,8 @@ dependencies: config: - field.storage.node.field_listing_results_config - node.type.tide_search_listing + module: + - tide_content_collection id: node.tide_search_listing.field_listing_results_config field_name: field_listing_results_config entity_type: node diff --git a/config/optional/field.field.node.tide_search_listing.field_search_configuration.yml b/config/optional/field.field.node.tide_search_listing.field_search_configuration.yml index ba3a014..cc79687 100644 --- a/config/optional/field.field.node.tide_search_listing.field_search_configuration.yml +++ b/config/optional/field.field.node.tide_search_listing.field_search_configuration.yml @@ -4,6 +4,8 @@ dependencies: config: - field.storage.node.field_search_configuration - node.type.tide_search_listing + module: + - tide_content_collection id: node.tide_search_listing.field_search_configuration field_name: field_search_configuration entity_type: node diff --git a/config/optional/field.field.paragraph.listing_custom_filter.field_listing_custom_filter_conf.yml b/config/optional/field.field.paragraph.listing_custom_filter.field_listing_custom_filter_conf.yml index 814b2a0..a542c1d 100644 --- a/config/optional/field.field.paragraph.listing_custom_filter.field_listing_custom_filter_conf.yml +++ b/config/optional/field.field.paragraph.listing_custom_filter.field_listing_custom_filter_conf.yml @@ -4,6 +4,8 @@ dependencies: config: - field.storage.paragraph.field_listing_custom_filter_conf - paragraphs.paragraphs_type.listing_custom_filter + module: + - tide_content_collection id: paragraph.listing_custom_filter.field_listing_custom_filter_conf field_name: field_listing_custom_filter_conf entity_type: paragraph diff --git a/config/optional/field.field.paragraph.listing_user_custom_filter.field_user_filter_configuration.yml b/config/optional/field.field.paragraph.listing_user_custom_filter.field_user_filter_configuration.yml index b887c05..8c36986 100644 --- a/config/optional/field.field.paragraph.listing_user_custom_filter.field_user_filter_configuration.yml +++ b/config/optional/field.field.paragraph.listing_user_custom_filter.field_user_filter_configuration.yml @@ -4,6 +4,8 @@ dependencies: config: - field.storage.paragraph.field_user_filter_configuration - paragraphs.paragraphs_type.listing_user_custom_filter + module: + - tide_content_collection id: paragraph.listing_user_custom_filter.field_user_filter_configuration field_name: field_user_filter_configuration entity_type: paragraph diff --git a/config/optional/field.field.paragraph.search_listing_header_component.field_header_configuration.yml b/config/optional/field.field.paragraph.search_listing_header_component.field_header_configuration.yml index e432b8b..1fbbf97 100644 --- a/config/optional/field.field.paragraph.search_listing_header_component.field_header_configuration.yml +++ b/config/optional/field.field.paragraph.search_listing_header_component.field_header_configuration.yml @@ -4,6 +4,8 @@ dependencies: config: - field.storage.paragraph.field_header_configuration - paragraphs.paragraphs_type.search_listing_header_component + module: + - tide_content_collection id: paragraph.search_listing_header_component.field_header_configuration field_name: field_header_configuration entity_type: paragraph diff --git a/config/optional/field.storage.node.field_custom_sort_configuration.yml b/config/optional/field.storage.node.field_custom_sort_configuration.yml index 4413eab..c4e0c4f 100644 --- a/config/optional/field.storage.node.field_custom_sort_configuration.yml +++ b/config/optional/field.storage.node.field_custom_sort_configuration.yml @@ -4,6 +4,7 @@ dependencies: module: - field_permissions - node + - tide_content_collection third_party_settings: field_permissions: permission_type: public diff --git a/config/optional/field.storage.node.field_listing_query_config.yml b/config/optional/field.storage.node.field_listing_query_config.yml index e315c85..1efe446 100644 --- a/config/optional/field.storage.node.field_listing_query_config.yml +++ b/config/optional/field.storage.node.field_listing_query_config.yml @@ -4,6 +4,7 @@ dependencies: module: - field_permissions - node + - tide_content_collection third_party_settings: field_permissions: permission_type: public diff --git a/config/optional/field.storage.node.field_listing_results_config.yml b/config/optional/field.storage.node.field_listing_results_config.yml index 90c6238..58a416e 100644 --- a/config/optional/field.storage.node.field_listing_results_config.yml +++ b/config/optional/field.storage.node.field_listing_results_config.yml @@ -4,6 +4,7 @@ dependencies: module: - field_permissions - node + - tide_content_collection third_party_settings: field_permissions: permission_type: public diff --git a/config/optional/field.storage.node.field_search_configuration.yml b/config/optional/field.storage.node.field_search_configuration.yml index 07a4b23..608d498 100644 --- a/config/optional/field.storage.node.field_search_configuration.yml +++ b/config/optional/field.storage.node.field_search_configuration.yml @@ -3,6 +3,7 @@ status: true dependencies: module: - node + - tide_content_collection id: node.field_search_configuration field_name: field_search_configuration entity_type: node diff --git a/config/optional/field.storage.paragraph.field_header_configuration.yml b/config/optional/field.storage.paragraph.field_header_configuration.yml index 3c72b6c..0f4ffec 100644 --- a/config/optional/field.storage.paragraph.field_header_configuration.yml +++ b/config/optional/field.storage.paragraph.field_header_configuration.yml @@ -4,6 +4,7 @@ dependencies: module: - field_permissions - paragraphs + - tide_content_collection third_party_settings: field_permissions: permission_type: public diff --git a/config/optional/field.storage.paragraph.field_listing_custom_filter_conf.yml b/config/optional/field.storage.paragraph.field_listing_custom_filter_conf.yml index cbbfb6e..19c3605 100644 --- a/config/optional/field.storage.paragraph.field_listing_custom_filter_conf.yml +++ b/config/optional/field.storage.paragraph.field_listing_custom_filter_conf.yml @@ -4,6 +4,7 @@ dependencies: module: - field_permissions - paragraphs + - tide_content_collection third_party_settings: field_permissions: permission_type: public diff --git a/config/optional/field.storage.paragraph.field_user_filter_configuration.yml b/config/optional/field.storage.paragraph.field_user_filter_configuration.yml index d5885f0..1361465 100644 --- a/config/optional/field.storage.paragraph.field_user_filter_configuration.yml +++ b/config/optional/field.storage.paragraph.field_user_filter_configuration.yml @@ -4,6 +4,7 @@ dependencies: module: - field_permissions - paragraphs + - tide_content_collection third_party_settings: field_permissions: permission_type: public diff --git a/tide_search.info.yml b/tide_search.info.yml index 011528d..9bec553 100644 --- a/tide_search.info.yml +++ b/tide_search.info.yml @@ -6,6 +6,8 @@ core_version_requirement: ^9 || ^10 dependencies: - search_api:search_api - elasticsearch_connector:elasticsearch_connector + - dpc-sdp:tide_api + - tide_api:tide_content_collection - dpc-sdp:tide_core - dpc-sdp:tide_landing_page - paragraphs diff --git a/tide_search.install b/tide_search.install index 7ef2dd1..b8a9c53 100644 --- a/tide_search.install +++ b/tide_search.install @@ -24,3 +24,35 @@ function tide_search_update_10001() { $module_installer->install(['tide_data_pipeline']); } } + +/** + * Add secondary campaign to search listing. + */ +function tide_search_update_10002() { + \Drupal::moduleHandler()->loadInclude('tide_core', 'inc', 'includes/helpers'); + $config_location = [\Drupal::service('extension.list.module')->getPath('tide_search') . '/config/optional']; + + $config = 'field.field.node.tide_search_listing.field_landing_page_c_secondary'; + $type = 'field_config'; + $config_read = _tide_read_config($config, $config_location); + $storage = \Drupal::entityTypeManager()->getStorage($type); + $id = substr($config, strrpos($config, '.') + 1); + if ($storage->load($id) == NULL) { + $config_entity = $storage->createFromStorageRecord($config_read); + $config_entity->save(); + } + + $form_configs = [ + 'core.entity_view_display.node.tide_search_listing.default', + 'core.entity_form_display.node.tide_search_listing.default', + 'core.entity_view_display.node.tide_search_listing.teaser', + ]; + foreach ($form_configs as $form_config) { + $config = \Drupal::configFactory()->getEditable($form_config); + $config_read = _tide_read_config($form_config, $config_location, FALSE); + $config->set('dependencies', $config_read['dependencies']); + $config->set('content', $config_read['content']); + $config->set('hidden', $config_read['hidden']); + $config->save(); + } +}