function tft_update_8001 in Taxonomy File Tree 8
Creates the opigno_moxtra_recording_link field in the tft_file.
File
- ./
tft.install, line 15 - Install, update and uninstall functions for the TFT module.
Code
function tft_update_8001() {
$config_path = drupal_get_path('module', 'tft') . '/config/optional';
$storage = new FileStorage($config_path);
$data = $storage
->read('field.storage.media.opigno_moxtra_recording_link');
if (!FieldStorageConfig::loadByName($data['entity_type'], $data['field_name'])) {
FieldStorageConfig::create($data)
->save();
}
$data = $storage
->read('field.field.media.tft_file.opigno_moxtra_recording_link');
if (!FieldConfig::loadByName($data['entity_type'], $data['bundle'], $data['field_name'])) {
FieldConfig::create($data)
->save();
}
}