Skip to content

Commit

Permalink
#302: install hooks for the podcast fields / group
Browse files Browse the repository at this point in the history
  • Loading branch information
komejo committed Aug 15, 2024
1 parent faf8bf9 commit 5632759
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions modules/wri_data/wri_data.install
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,27 @@ function wri_data_update_dependencies() {

return $dependencies;
}

/**
* Update the Data content type to add fields and field group.
*/
function wri_data_update_10001() {
// Add the fields.
\Drupal::service('distro_helper.updates')->installConfig('field.storage.node.field_apple_podcasts', 'wri_data', 'install', 'TRUE');
\Drupal::service('distro_helper.updates')->installConfig('field.field.node.data.field_apple_podcasts', 'wri_data', 'install', 'TRUE');
\Drupal::service('distro_helper.updates')->installConfig('field.storage.node.field_spotify', 'wri_data', 'install', 'TRUE');
\Drupal::service('distro_helper.updates')->installConfig('field.field.node.data.field_spotify', 'wri_data', 'install', 'TRUE');
\Drupal::service('distro_helper.updates')->installConfig('field.storage.node.field_youtube', 'wri_data', 'install', 'TRUE');
\Drupal::service('distro_helper.updates')->installConfig('field.field.node.data.field_youtube', 'wri_data', 'install', 'TRUE');

// Updating the Data form/view displays.
\Drupal::service('distro_helper.updates')->updateConfig('core.entity_form_display.node.data.default', [
'third_party_settings#field_group#group_podcasts',
'content#field_apple_podcasts',
'content#field_spotify',
'content#field_youtube',
], 'wri_data');

$message = 'Add the podcast link fields and Podcasts tab group.';
return $message;
}

0 comments on commit 5632759

Please sign in to comment.