Skip to content

Commit

Permalink
updated hook
Browse files Browse the repository at this point in the history
  • Loading branch information
yeniatencio committed Mar 6, 2024
1 parent 7ac4f19 commit 409573c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tide_core.install
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,22 @@ function tide_core_update_10002() {
*/
function tide_core_update_10003() {
module_load_include('inc', 'tide_core', 'includes/helpers');
$configs = [
'field.field.paragraph.accordion.field_paragraph_body' => 'field_config',
];
$config_location = [\Drupal::service('extension.list.module')->getPath('tide_core') . '/config/install'];
// Check if field already exported to config/sync.
foreach ($configs as $config => $type) {
$config_read = _tide_read_config($config, $config_location, TRUE);
$storage = \Drupal::entityTypeManager()->getStorage($type);
$id = substr($config, strrpos($config, '.') + 1);
if ($storage->load($id) == NULL) {
$config_entity = $storage->createFromStorageRecord($config_read);
$config_entity->save();
}
}

$form_configs = [
'field.field.paragraph.accordion.field_paragraph_body',
'core.entity_form_display.paragraph.accordion.default',
'core.entity_view_display.paragraph.accordion.default',
'core.entity_view_display.paragraph.accordion.preview',
Expand Down

0 comments on commit 409573c

Please sign in to comment.