From 6b4dda5bb8d1ad02259eb73bcb2c209cd38cadf2 Mon Sep 17 00:00:00 2001 From: matze Date: Wed, 18 Dec 2024 16:51:08 +0100 Subject: [PATCH] delete .install file it aint the way --- farm_agrikern.install | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 farm_agrikern.install diff --git a/farm_agrikern.install b/farm_agrikern.install deleted file mode 100644 index 004ef40..0000000 --- a/farm_agrikern.install +++ /dev/null @@ -1,40 +0,0 @@ -** -* Updates allowed taxonomy types. -*/ -function farm_agrikern_update_1(&$sandbox) { - - $config_ids = [ - 'taxonomy.vocabulary.chemical', - 'taxonomy.vocabulary.work_type', - ]; - - foreach ($config_ids as $config_id) { - // Check if the configuration already exists. - $existing_config = \Drupal::config($config_id); - if ($existing_config->isNew()) { - // Load the YAML file from the module's config/install directory. - $config_storage = \Drupal::service('config.storage'); - $data = $config_storage->read($config_id); - - if ($data) { - // Import the configuration. - $config_importer = \Drupal::service('config.installer'); - $config_importer->create($config_id, $data); - \Drupal::messenger()->addMessage("Configuration '{$config_id}' imported."); - } - else { - \Drupal::messenger()->addMessage("Configuration file for '{$config_id}' not found.", 'error'); - } - } - else { - \Drupal::messenger()->addMessage("Configuration '{$config_id}' already exists.", 'warning'); - } - } -} -} \ No newline at end of file