Skip to content

Commit

Permalink
Removed transliterate_filenames module dependency in favor of core 10…
Browse files Browse the repository at this point in the history
….2 settings
  • Loading branch information
pookmish committed Jan 8, 2024
1 parent 7577455 commit d9b147c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 1 addition & 2 deletions stanford_media.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,4 +18,3 @@ dependencies:
- focal_point:focal_point
- inline_entity_form:inline_entity_form
- oembed_providers:oembed_providers
- transliterate_filenames:transliterate_filenames
25 changes: 22 additions & 3 deletions stanford_media.install
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

0 comments on commit d9b147c

Please sign in to comment.