From d9b147c546199fda0b6d01f8c7bbd12debfa4ef8 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Mon, 8 Jan 2024 08:42:38 -0800 Subject: [PATCH] Removed transliterate_filenames module dependency in favor of core 10.2 settings --- composer.json | 3 +-- stanford_media.info.yml | 3 +-- stanford_media.install | 25 ++++++++++++++++++++++--- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index bf6da0f..2761b73 100644 --- a/composer.json +++ b/composer.json @@ -22,13 +22,12 @@ "require": { "php": ">=8.1", "davidbarratt/custom-installer": "^1.1", - "drupal/core": "^10.0", + "drupal/core": "^10.2", "drupal/dropzonejs": "^2.7", "drupal/entity_usage": "^2.0@beta", "drupal/focal_point": "^2.0@alpha", "drupal/inline_entity_form": "^3.0", "drupal/oembed_providers": "^2.1", - "drupal/transliterate_filenames": "^2.0", "enyo/dropzone": "^5.9" }, "extra": { diff --git a/stanford_media.info.yml b/stanford_media.info.yml index 6c1148c..f734ba2 100644 --- a/stanford_media.info.yml +++ b/stanford_media.info.yml @@ -3,7 +3,7 @@ description: Provides media module configuration and plugins. core_version_requirement: ^10 package: media type: module -version: 10.1.4 +version: 11.0.0 dependencies: - dropzonejs:dropzonejs - drupal:breakpoint @@ -18,4 +18,3 @@ dependencies: - focal_point:focal_point - inline_entity_form:inline_entity_form - oembed_providers:oembed_providers - - transliterate_filenames:transliterate_filenames diff --git a/stanford_media.install b/stanford_media.install index 60a101e..388c8ae 100644 --- a/stanford_media.install +++ b/stanford_media.install @@ -6,8 +6,27 @@ */ /** - * Removed 9.0.0. + * Implements hook_install(). */ -function stanford_media_update_8220() { - // Removed 9.0.0. +function stanford_media_install() { + \Drupal::configFactory()->getEditable('file.settings') + ->set('filename_sanitization.deduplicate_separators', TRUE) + ->set('filename_sanitization.lowercase', TRUE) + ->set('filename_sanitization.replace_non_alphanumeric', TRUE) + ->set('filename_sanitization.replace_whitespace', TRUE) + ->set('filename_sanitization.transliterate', TRUE) + ->set('filename_sanitization.replacement_character', '-') + ->save(); +} + +/** + * Uninstall transliterate_filenames module. + */ +function stanford_media_update_11000() { + if (\Drupal::moduleHandler()->moduleExists('transliterate_filenames')) { + \Drupal::service('module_installer')->uninstall([ + 'transliterate_filenames', + ]); + } + stanford_media_install(); }