thunder_ivw.install in Thunder 6.2.x
Same filename and directory in other branches
Thunder IVW install hooks.
File
modules/thunder_ivw/thunder_ivw.installView source
<?php
/**
* @file
* Thunder IVW install hooks.
*/
/**
* Implements hook_install().
*/
function thunder_ivw_install() {
$fieldWidget = 'ivw_integration_widget';
// Attach field if channel vocabulary and article node type is
// present in the distribution.
try {
\Drupal::service('entity_display.repository')
->getFormDisplay('node', 'article', 'default')
->setComponent('field_ivw', [
'type' => $fieldWidget,
])
->save();
} catch (Exception $e) {
\Drupal::logger('thunder')
->info(t('Could not add ivw field to article node: "@message"', [
'@message' => $e
->getMessage(),
]));
}
try {
\Drupal::service('entity_display.repository')
->getFormDisplay('taxonomy_term', 'channel', 'default')
->setComponent('field_ivw', [
'type' => $fieldWidget,
])
->save();
} catch (Exception $e) {
\Drupal::logger('thunder')
->info(t('Could not add ivw field to channel taxonomy: "@message"', [
'@message' => $e
->getMessage(),
]));
}
}
/* hook_update_n implementations should be in the profile instead of this
submodule. */
Functions
Name | Description |
---|---|
thunder_ivw_install | Implements hook_install(). |