From 789d566c23b8fa171fa161aa8a6e12a81041c339 Mon Sep 17 00:00:00 2001 From: stonebuzz Date: Thu, 21 Nov 2024 11:05:15 +0100 Subject: [PATCH] Fix(Generate): generate Dropdown before container --- setup.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/setup.php b/setup.php index e84d6c01..807ff9d2 100644 --- a/setup.php +++ b/setup.php @@ -264,6 +264,15 @@ function plugin_fields_checkFiles() // Clean all existing files array_map('unlink', glob(PLUGINFIELDS_DOC_DIR . '/*/*')); + // Regenerate dropdowns + if ($DB->tableExists(PluginFieldsField::getTable())) { + $fields_obj = new PluginFieldsField(); + $fields = $fields_obj->find(['type' => 'dropdown']); + foreach ($fields as $field) { + PluginFieldsDropdown::create($field); + } + } + // Regenerate containers if ($DB->tableExists(PluginFieldsContainer::getTable())) { $container_obj = new PluginFieldsContainer(); @@ -274,14 +283,6 @@ function plugin_fields_checkFiles() } } - // Regenerate dropdowns - if ($DB->tableExists(PluginFieldsField::getTable())) { - $fields_obj = new PluginFieldsField(); - $fields = $fields_obj->find(['type' => 'dropdown']); - foreach ($fields as $field) { - PluginFieldsDropdown::create($field); - } - } } function plugin_fields_exportBlockAsYaml($container_id = null)