From ba75329d96fba93b730b1a6165112a96aa0a39a9 Mon Sep 17 00:00:00 2001 From: sharmasahil Date: Wed, 27 Nov 2024 14:30:26 +1100 Subject: [PATCH] Settings for media alias display for documents type --- composer.json | 3 ++- config/install/media_alias_display.settings.yml | 4 ++++ modules/tide_media/tide_media.install | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 config/install/media_alias_display.settings.yml diff --git a/composer.json b/composer.json index 75d430f8a..f2c32c975 100644 --- a/composer.json +++ b/composer.json @@ -120,7 +120,8 @@ "codemirror/codemirror": "5.65.12", "jquery/inputmask": "5.0.8", "jquery/intl-tel-input": "17.0.19", - "progress-tracker/progress-tracker": "2.0.7" + "progress-tracker/progress-tracker": "2.0.7", + "drupal/media_alias_display": "^2.1" }, "repositories": { "drupal": { diff --git a/config/install/media_alias_display.settings.yml b/config/install/media_alias_display.settings.yml new file mode 100644 index 000000000..d02fa1453 --- /dev/null +++ b/config/install/media_alias_display.settings.yml @@ -0,0 +1,4 @@ +_core: + default_config_hash: WYvSMTu0VCW_FhkuJjHuUhmJ9nerYL0JtZrvGJajNig +kill_switch: false +media_bundles: { } diff --git a/modules/tide_media/tide_media.install b/modules/tide_media/tide_media.install index dc5a250da..58cbc0f60 100644 --- a/modules/tide_media/tide_media.install +++ b/modules/tide_media/tide_media.install @@ -81,3 +81,19 @@ function tide_media_update_10005() { $config->set('track_enabled_target_entity_types', $result); $config->save(); } + +/** + * Adds media_alias_display settings for document type. + */ +function tide_media_update_10006() { + if (\Drupal::moduleHandler()->moduleExists('media_alias_display') === FALSE) { + \Drupal::service('module_installer')->install(['media_alias_display']); + } + + $media_config = \Drupal::service('config.factory')->getEditable('media_alias_display.settings'); + if ($media_config ) { + $media_config->set('media_bundles', ['document' => 'document']); + $media_config->save(); + } +} +