From 36c69a063b648eeac042bac0a6df1d58ba9c45e7 Mon Sep 17 00:00:00 2001 From: Samuell Date: Mon, 22 Jul 2019 07:45:31 +0200 Subject: [PATCH] Add support for tab icons in theme customization (#4464) Fixes #4131. Credit to @Samuell1 --- modules/cms/controllers/ThemeOptions.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/modules/cms/controllers/ThemeOptions.php b/modules/cms/controllers/ThemeOptions.php index 8ce11e4d6..b20fd5eae 100644 --- a/modules/cms/controllers/ThemeOptions.php +++ b/modules/cms/controllers/ThemeOptions.php @@ -89,23 +89,12 @@ class ThemeOptions extends Controller /** * Add form fields defined in theme.yaml */ - public function formExtendFields($form) + public function formExtendFieldsBefore($form) { $model = $form->model; $theme = $this->findThemeObject($model->theme); - $config = $theme->getFormConfig(); - - if ($fields = array_get($config, 'fields')) { - $form->addFields($fields); - } - - if ($fields = array_get($config, 'tabs.fields')) { - $form->addTabFields($fields); - } - - if ($fields = array_get($config, 'secondaryTabs.fields')) { - $form->addSecondaryTabFields($fields); - } + $form->config = $this->mergeConfig($form->config, $theme->getFormConfig()); + $form->init(); } //