Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/4.0.1-p2'
Browse files Browse the repository at this point in the history
4.0.1-p2
  • Loading branch information
MdNadimHossain committed Mar 21, 2024
2 parents b49d362 + f46cc2b commit 0a8d962
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 2 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"Error: Call to a member function getKeyValue on null - https://www.drupal.org/project/key/issues/3385523": "https://www.drupal.org/files/issues/2023-09-06/3385523-4.patch"
},
"drupal/data_pipelines": {
"CSV data header row whitespace needs to be cleaned up - https://drupal.org/project/data_pipelines/issues/3391214": "https://www.drupal.org/files/issues/2023-10-03/trim-whitespace-from-csv-header-names-3391214-2.patch"
"CSV data header row whitespace needs to be cleaned up - https://drupal.org/project/data_pipelines/issues/3391214": "https://www.drupal.org/files/issues/2023-10-03/trim-whitespace-from-csv-header-names-3391214-2.patch",
"set a default value based on certain criteria - https://www.drupal.org/project/data_pipelines/issues/3426248#comment-15507258": "https://www.drupal.org/files/issues/2024-03-21/data_pipelines-3426248-6.patch.patch"
}
},
"drush": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.node.tide_search_listing.field_above_results_content
- field.field.node.tide_search_listing.field_below_results_content
- field.field.node.tide_search_listing.field_custom_sort_configuration
- field.field.node.tide_search_listing.field_featured_image
Expand Down Expand Up @@ -147,6 +148,14 @@ content:
region: content
settings: { }
third_party_settings: { }
field_above_results_content:
type: text_textarea
weight: 7
region: content
settings:
rows: 5
placeholder: ''
third_party_settings: { }
field_below_results_content:
type: text_textarea
weight: 8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ langcode: en
status: true
dependencies:
config:
- field.field.node.tide_search_listing.field_above_results_content
- field.field.node.tide_search_listing.field_below_results_content
- field.field.node.tide_search_listing.field_custom_sort_configuration
- field.field.node.tide_search_listing.field_featured_image
Expand Down Expand Up @@ -42,6 +43,13 @@ content:
third_party_settings: { }
weight: -20
region: content
field_above_results_content:
type: text_default
label: above
settings: { }
third_party_settings: { }
weight: 16
region: content
field_below_results_content:
type: text_default
label: above
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ status: true
dependencies:
config:
- core.entity_view_mode.node.teaser
- field.field.node.tide_search_listing.field_above_results_content
- field.field.node.tide_search_listing.field_below_results_content
- field.field.node.tide_search_listing.field_custom_sort_configuration
- field.field.node.tide_search_listing.field_featured_image
Expand Down Expand Up @@ -45,6 +46,7 @@ content:
weight: 100
region: content
hidden:
field_above_results_content: true
field_below_results_content: true
field_custom_sort_configuration: true
field_featured_image: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_above_results_content
- node.type.tide_search_listing
module:
- allowed_formats
- text
third_party_settings:
allowed_formats:
allowed_formats: { }
id: node.tide_search_listing.field_above_results_content
field_name: field_above_results_content
entity_type: node
bundle: tide_search_listing
label: 'Above results content'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: text_long
22 changes: 22 additions & 0 deletions config/optional/field.storage.node.field_above_results_content.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
langcode: en
status: true
dependencies:
module:
- field_permissions
- node
- text
third_party_settings:
field_permissions:
permission_type: public
id: node.field_above_results_content
field_name: field_above_results_content
entity_type: node
type: text_long
settings: { }
module: text
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
2 changes: 1 addition & 1 deletion src/TideSearchOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function removeTideAlertFromDatasource() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('search_api.index.node');
$node_datasource_settings = $config->get('datasource_settings.entity:node.bundles.selected');
if (!in_array('alert', $node_datasource_settings)) {
if (is_array($node_datasource_settings) && !in_array('alert', $node_datasource_settings)) {
$node_datasource_settings[] = 'alert';
$config->set('datasource_settings.entity:node.bundles.selected', $node_datasource_settings);
$config->save();
Expand Down
34 changes: 34 additions & 0 deletions tide_search.install
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,37 @@ function tide_search_update_10002() {
$config->save();
}
}

/**
* Adds field_above_results_content field to search listing.
*/
function tide_search_update_10003() {
module_load_include('inc', 'tide_core', 'includes/helpers');
$config_location = [\Drupal::service('extension.list.module')->getPath('tide_search') . '/config/optional'];

$configs = [
'field.storage.node.field_above_results_content' => 'field_storage_config',
'field.field.node.tide_search_listing.field_above_results_content' => 'field_config',
];
// Check if field already exported to config/sync.
foreach ($configs as $config => $type) {
$config_read = _tide_read_config($config, $config_location, TRUE);
$storage = \Drupal::entityTypeManager()->getStorage($type);
$config_entity = $storage->createFromStorageRecord($config_read);
$config_entity->save();
}

$form_configs = [
'core.entity_form_display.node.tide_search_listing.default',
'core.entity_view_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();
}
}

0 comments on commit 0a8d962

Please sign in to comment.