diff --git a/.github/workflows/behat.yml b/.github/workflows/behat.yml index 37667b5a692..f273e4c5896 100644 --- a/.github/workflows/behat.yml +++ b/.github/workflows/behat.yml @@ -394,6 +394,11 @@ jobs: mv html/profiles/contrib/social/tests/behat/logs/* $OUTPUT_FOLDER/ fi + # Move files from the mail spool to the output folder if they exist + if (shopt -s nullglob; f=(html/profiles/contrib/social/tests/behat/mail-spool/*); ((${#f[@]}))); then + mv html/profiles/contrib/social/tests/behat/mail-spool/* $OUTPUT_FOLDER/ + fi + # Dump the database with the state of the test failure to allow for # local inspection. drush sql-dump > $OUTPUT_FOLDER/at-test-failure.sql diff --git a/modules/social_features/social_search/config/install/search_api.index.social_all.yml b/modules/social_features/social_search/config/install/search_api.index.social_all.yml index 91a194fb57f..52bc1afffb1 100644 --- a/modules/social_features/social_search/config/install/search_api.index.social_all.yml +++ b/modules/social_features/social_search/config/install/search_api.index.social_all.yml @@ -245,6 +245,7 @@ processor_settings: ignorecase: all_fields: true fields: + - language_with_fallback - field_group_description - field_group_location - field_profile_first_name @@ -332,6 +333,7 @@ processor_settings: transliteration: all_fields: true fields: + - language_with_fallback - field_group_description - field_group_location - field_profile_first_name diff --git a/modules/social_features/social_search/config/install/views.view.search_all.yml b/modules/social_features/social_search/config/install/views.view.search_all.yml index acb4f6e596c..512346c48dc 100644 --- a/modules/social_features/social_search/config/install/views.view.search_all.yml +++ b/modules/social_features/social_search/config/install/views.view.search_all.yml @@ -153,14 +153,13 @@ display: link_to_item: false multi_separator: ', ' filters: - language_with_fallback: - id: language_with_fallback + search_api_language: + id: search_api_language table: search_api_index_social_all field: language_with_fallback relationship: none group_type: group admin_label: '' - plugin_id: search_api_language operator: in value: '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' @@ -193,6 +192,7 @@ display: default_group: All default_group_multiple: { } group_items: { } + plugin_id: search_api_language sorts: search_api_relevance: id: search_api_relevance diff --git a/modules/social_features/social_search/config/install/views.view.search_content.yml b/modules/social_features/social_search/config/install/views.view.search_content.yml index 727307f81d1..4bb47a0945c 100644 --- a/modules/social_features/social_search/config/install/views.view.search_content.yml +++ b/modules/social_features/social_search/config/install/views.view.search_content.yml @@ -280,14 +280,13 @@ display: min: '' max: '' plugin_id: search_api_date - language_with_fallback: - id: language_with_fallback + search_api_language: + id: search_api_language table: search_api_index_social_content field: language_with_fallback relationship: none group_type: group admin_label: '' - plugin_id: search_api_language operator: in value: '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' @@ -300,7 +299,7 @@ display: use_operator: false operator: '' operator_limit_selection: false - operator_list: { } + operator_list: { } identifier: '' required: false remember: false @@ -318,8 +317,9 @@ display: multiple: false remember: false default_group: All - default_group_multiple: { } - group_items: { } + default_group_multiple: { } + group_items: { } + plugin_id: search_api_language sorts: search_api_relevance: id: search_api_relevance diff --git a/modules/social_features/social_search/config/install/views.view.search_groups.yml b/modules/social_features/social_search/config/install/views.view.search_groups.yml index 5246d3085af..8df90fefd33 100644 --- a/modules/social_features/social_search/config/install/views.view.search_groups.yml +++ b/modules/social_features/social_search/config/install/views.view.search_groups.yml @@ -172,14 +172,13 @@ display: group_items: { } reduce_duplicates: false plugin_id: search_api_options - language_with_fallback: - id: language_with_fallback + search_api_language: + id: search_api_language table: search_api_index_social_groups field: language_with_fallback relationship: none group_type: group admin_label: '' - plugin_id: search_api_language operator: in value: '***LANGUAGE_language_interface***': '***LANGUAGE_language_interface***' @@ -192,7 +191,7 @@ display: use_operator: false operator: '' operator_limit_selection: false - operator_list: { } + operator_list: { } identifier: '' required: false remember: false @@ -210,8 +209,9 @@ display: multiple: false remember: false default_group: All - default_group_multiple: { } - group_items: { } + default_group_multiple: { } + group_items: { } + plugin_id: search_api_language sorts: search_api_relevance: id: search_api_relevance diff --git a/modules/social_features/social_search/social_search.install b/modules/social_features/social_search/social_search.install index 6b52cf26110..2aea01bc7b8 100644 --- a/modules/social_features/social_search/social_search.install +++ b/modules/social_features/social_search/social_search.install @@ -291,3 +291,35 @@ function social_search_update_11402(): string { // Output logged messages to related channel of update execution. return $updateHelper->logger()->output(); } + +/** + * Revert search_api_language filter name/id change. + */ +function social_search_update_11403() : void { + // In social_search_update_11402 + // (https://github.com/goalgorilla/open_social/pull/3470/) we changed the + // search_api_language filter to a language_with_fallback filter to ensure + // that users could find matching content in different languages if no version + // in their own language was available. However, this also changed the IDs of + // the filter which can break existing sites that might rely on that filter. + // Below we go through the views and change the filter back to the ID it had, + // just with the new field added to the index. + $views = [ + "views.view.search_all", + "views.view.search_content", + "views.view.search_group", + ]; + + foreach ($views as $view) { + $config = \Drupal::configFactory()->getEditable($view); + $display = $config->get("display"); + + $filter = $display['default']['display_options']['filters']['language_with_fallback']; + $filter['id'] = "search_api_language"; + $display['default']['display_options']['filters']["search_api_language"] = $filter; + unset($display['default']['display_options']['filters']['language_with_fallback']); + + $config->set('display', $display); + $config->save(TRUE); + } +}