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

Release/4.1.0 #77

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies:
- field.field.node.tide_search_listing.field_topic
- node.type.tide_search_listing
- workflows.workflow.editorial
- field.field.node.tide_search_listing.field_content_category
module:
- content_moderation
- field_group
Expand All @@ -37,6 +38,7 @@ dependencies:
- select2
- text
- tide_content_collection
- term_reference_tree
third_party_settings:
field_group:
group_search_listing_header:
Expand Down Expand Up @@ -388,6 +390,17 @@ content:
size: 60
placeholder: ''
third_party_settings: { }
field_content_category:
type: term_reference_tree
weight: 11
region: content
settings:
start_minimized: true
leaves_only: true
select_parents: false
cascading_selection: 0
max_depth: 0
third_party_settings: { }
moderation_state:
type: moderation_state_default
weight: 20
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
langcode: en
status: true
dependencies:
config:
- field.storage.node.field_content_category
- node.type.tide_search_listing
- taxonomy.vocabulary.content_category
id: node.tide_search_listing.field_content_category
field_name: field_content_category
entity_type: node
bundle: tide_search_listing
label: 'Content category'
description: 'Select the most relevant option from the <a href="https://www.vic.gov.au/content-categories">list of content categories</a>. This mandatory field will help with search and filtering on the website.'
required: true
translatable: true
default_value: { }
default_value_callback: ''
settings:
handler: 'default:taxonomy_term'
handler_settings:
target_bundles:
content_category: content_category
sort:
field: name
direction: asc
auto_create: false
auto_create_bundle: ''
field_type: entity_reference
27 changes: 27 additions & 0 deletions tide_search.install
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ function tide_search_install() {
$tideSearchOperation->removeTideAlertFromDatasource();
}

/**
* Implements hook_update_dependencies().
*/
function tide_search_update_dependencies() {
$dependencies = [];
$dependencies['tide_search'][10004] = ['tide_core' => 10005];
return $dependencies;
}

/**
* Install module tide_data_pipeline.
*/
Expand Down Expand Up @@ -90,3 +99,21 @@ function tide_search_update_10003() {
$config->save();
}
}

/**
* Imports field_content_category field for existing sites.
*/
function tide_search_update_10004() {
\Drupal::moduleHandler()->loadInclude('tide_core', 'inc', 'includes/helpers');
$config_location = [\Drupal::service('extension.list.module')->getPath('tide_search') . '/config/optional'];
$config_read = _tide_read_config('field.field.node.tide_search_listing.field_content_category', $config_location, TRUE);
$storage = \Drupal::entityTypeManager()->getStorage('field_config');
$id = $storage->getIDFromConfigName('field.field.node.tide_search_listing.field_content_category', $storage->getEntityType()->getConfigPrefix());
if ($storage->load($id) == NULL) {
$config_entity = $storage->createFromStorageRecord($config_read);
$config_entity->save();
}
\Drupal::moduleHandler()->loadInclude('tide_core', 'inc', 'includes/updates');
_tide_core_field_content_category_default_value('tide_search_listing', 'Search listing');
_tide_core_content_category_form_display('tide_search_listing');
}
Loading