dannylamb
5 years ago
committed by
Jared Whiklo
10 changed files with 22 additions and 32 deletions
@ -1,23 +0,0 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* @file |
||||
* Install/update hook implementations. |
||||
*/ |
||||
|
||||
use Drupal\field\Entity\FieldConfig; |
||||
|
||||
/** |
||||
* Implements hook_install(). |
||||
*/ |
||||
function islandora_text_extraction_install() { |
||||
// Add txt extension if it doesn't already exist;. |
||||
$field = FieldConfig::load("media.file.field_media_file"); |
||||
$fieldSettings = $field->getSettings(); |
||||
$extensions = $fieldSettings['file_extensions']; |
||||
if (!strpos($extensions, 'txt')) { |
||||
$fieldSettings['file_extensions'] .= ' txt'; |
||||
$field->set('settings', $fieldSettings); |
||||
$field->save(); |
||||
} |
||||
} |
Loading…
Reference in new issue