Skip to content

Commit

Permalink
Merge pull request #1915 from acquia/ACMS-4246-refactor
Browse files Browse the repository at this point in the history
ACMS-4246: Refactor Acquia Starter Kit Search to work with recipe.
  • Loading branch information
vishalkhode1 authored Jan 15, 2025
2 parents eb46b6b + 17281b8 commit 4d43d8f
Show file tree
Hide file tree
Showing 37 changed files with 288 additions and 129 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@
"drupal/core": "-p2"
},
"patches": {
"acquia/cohesion": {
"3340269 - Site Studio Drupal 11.1 compatibility": "https://www.drupal.org/files/issues/2025-01-09/3340269-site-studio-drupal-11-1-compatibility.patch"
},
"drupal/core": {
"3328187 - PHP Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in docroot/core/lib/Drupal/Core/Mail/Plugin/Mail/PhpMail.php on line 112": "https://git.drupalcode.org/project/drupal/-/merge_requests/3142.patch",
"Fix failing test for site studio due to missing file": "https://gist.githubusercontent.com/chandan-singh7929/978c8c3c8b6f1e2de23492e7e562c0c3/raw/f0e7770d94be862e5495ca25662a0a0d5672b785/bypass-library-version-core.patch"
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_article
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Article Type'
id: node.field_article_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dependencies:
module:
- acquia_cms_article
third_party_settings:
acquia_cms_search:
search_index: content
acquia_cms_common:
workflow_id: editorial
workbench_email_templates:
Expand All @@ -18,7 +20,6 @@ third_party_settings:
open_graph: open_graph
schema_article: schema_article
twitter_cards: twitter_cards
search_index: content
subtype:
field: field_article_type
facet: articles_article_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dependencies:
- search_api.index.content
- views.view.articles_fallback
module:
- acquia_cms_common
- acquia_cms_search
- search_api
- user
Expand Down
17 changes: 0 additions & 17 deletions modules/acquia_cms_common/acquia_cms_common.module
Original file line number Diff line number Diff line change
Expand Up @@ -64,23 +64,6 @@ function acquia_cms_common_form_alter(&$form, FormStateInterface $form_state, $f
}
}

/**
* Implements hook_views_data().
*/
function acquia_cms_common_views_data() {
return [
'views' => [
'main_listing_pages_view' => [
'title' => t('Main listing pages - Text area'),
'help' => t('Insert a text area inside a main view listing pages if the search server is available. If the view is not based on a Search API index, this behaves like a standard text area.'),
'area' => [
'id' => 'main_listing_pages_view',
],
],
],
];
}

/**
* Implements hook_theme().
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- node
- taxonomy
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: Categories
id: node.field_categories
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,19 @@ node.type.*.third_party.acquia_cms_common:
type: string
label: 'Machine name of the sitemap variant where the content type will be added'

field.storage.*.*.third_party.acquia_cms_common:
acquia_cms_common.settings:
type: config_object
label: 'Acquia CMS settings'
mapping:
user_login_redirection:
type: boolean
label: 'Enable special redirection on user login for specific roles'
starter_kit_name:
type: string
label: 'The starterkit name'

# This is added to make test pass.
field.storage.*.*.third_party.acquia_cms_search:
type: mapping
label: 'Acquia CMS settings'
mapping:
Expand All @@ -52,14 +64,3 @@ field.storage.*.*.third_party.acquia_cms_common:
search_label:
type: string
label: 'The label of the field in the Search API index'

acquia_cms_common.settings:
type: config_object
label: 'Acquia CMS settings'
mapping:
user_login_redirection:
type: boolean
label: 'Enable special redirection on user login for specific roles'
starter_kit_name:
type: string
label: 'The starterkit name'
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_event
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Door Time'
id: node.field_door_time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
module:
- acquia_cms_event
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Event Duration'
id: node.field_event_duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_event
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Event End Date'
id: node.field_event_end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_event
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Event Start Date'
id: node.field_event_start
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_event
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Event Type'
id: node.field_event_type
Expand Down
3 changes: 2 additions & 1 deletion modules/acquia_cms_event/config/optional/node.type.event.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dependencies:
module:
- acquia_cms_event
third_party_settings:
acquia_cms_search:
search_index: content
acquia_cms_common:
workflow_id: editorial
workbench_email_templates:
Expand All @@ -22,7 +24,6 @@ third_party_settings:
field: field_event_type
facet: events_event_type
sitemap_variant: default
search_index: content
menu_ui:
available_menus:
- main
Expand Down
3 changes: 2 additions & 1 deletion modules/acquia_cms_page/config/optional/node.type.page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ dependencies:
module:
- acquia_cms_page
third_party_settings:
acquia_cms_search:
search_index: content
acquia_cms_common:
workflow_id: editorial
workbench_email_templates:
Expand All @@ -23,7 +25,6 @@ third_party_settings:
schema_article: schema_article
twitter_cards: twitter_cards
sitemap_variant: default
search_index: content
menu_ui:
available_menus:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
module:
- acquia_cms_person
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: Email
id: node.field_email
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
module:
- acquia_cms_person
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: Job Title
id: node.field_job_title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_person
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Person Telephone'
id: node.field_person_telephone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_person
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Person Type'
id: node.field_person_type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dependencies:
module:
- acquia_cms_person
third_party_settings:
acquia_cms_search:
search_index: content
acquia_cms_common:
workflow_id: editorial
workbench_email_templates:
Expand All @@ -22,7 +24,6 @@ third_party_settings:
field: field_person_type
facet: people_person_type
sitemap_variant: default
search_index: content
menu_ui:
available_menus:
- main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_place
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Place Address'
id: node.field_place_address
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_place
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Place Telephone'
id: node.field_place_telephone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
module:
- acquia_cms_place
third_party_settings:
acquia_cms_common:
acquia_cms_search:
search_index: content
search_label: 'Place Type'
id: node.field_place_type
Expand Down
3 changes: 2 additions & 1 deletion modules/acquia_cms_place/config/optional/node.type.place.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ dependencies:
module:
- acquia_cms_place
third_party_settings:
acquia_cms_search:
search_index: content
acquia_cms_common:
workflow_id: editorial
workbench_email_templates:
Expand All @@ -22,7 +24,6 @@ third_party_settings:
field: field_place_type
facet: places_place_type
sitemap_variant: default
search_index: content
menu_ui:
available_menus:
- main
Expand Down
1 change: 0 additions & 1 deletion modules/acquia_cms_search/acquia_cms_search.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ description: "Provides powerful search capabilities to the site"
type: module
core_version_requirement: ^10.1 || ^11
dependencies:
- acquia_cms_common:acquia_cms_common
- collapsiblock:collapsiblock
- facets:facets
- facets_pretty_paths:facets_pretty_paths
Expand Down
17 changes: 6 additions & 11 deletions modules/acquia_cms_search/acquia_cms_search.install
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,16 @@ function acquia_cms_search_install($is_syncing) {

// Retroactively enable indexing for any content types that existed before
// this module was installed.
$node_types = NodeType::loadMultiple();
$entity_type_manager = \Drupal::entityTypeManager();
$node_types = $entity_type_manager->getStorage('node_type')->loadMultiple();
array_walk($node_types, 'acquia_cms_search_node_type_insert');
$enabled_modules = \Drupal::service('module_handler')->getModuleList();
$enabled_modules = array_keys($enabled_modules);
_acquia_cms_search_add_category_facet($enabled_modules);
$search_category = $entity_type_manager->getStorage('facets_facet')->loadByProperties(['id' => 'search_category']);
if (!$search_category) {
_acquia_cms_search_add_category_facet();
}
}
}

/**
* Implements hook_module_preinstall().
*/
function acquia_cms_search_module_preinstall($module) {
\Drupal::service('acquia_cms_common.utility')->setModulePreinstallTriggered($module);
}

/**
* Added enforced dependency in site studio templates for Acquia CMS Search.
*
Expand Down
Loading

0 comments on commit 4d43d8f

Please sign in to comment.