From d593f586786fdec7f9053ccf60f2bdb94175ddef Mon Sep 17 00:00:00 2001 From: trendschau Date: Tue, 12 Nov 2024 16:01:15 +0100 Subject: [PATCH] fix error if theme settings are missing --- system/typemill/Models/Extension.php | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/system/typemill/Models/Extension.php b/system/typemill/Models/Extension.php index cf0151c..ab4a503 100644 --- a/system/typemill/Models/Extension.php +++ b/system/typemill/Models/Extension.php @@ -86,21 +86,24 @@ class Extension { $themeSettings = $this->storage->getYaml('themesFolder', $themeName, $themeName . '.yaml'); - # add standard-textarea for custom css - $themeSettings['forms']['fields']['fieldsetcss'] = [ - 'type' => 'fieldset', - 'legend' => Translations::translate('Custom CSS'), - 'fields' => [ - 'customcss' => [ - 'type' => 'codearea', - 'label' => Translations::translate('Add your individual CSS'), - 'class' => 'codearea', - 'description' => Translations::translate('You can overwrite the theme-css with your own css here.') + if($themeSettings) + { + # add standard-textarea for custom css + $themeSettings['forms']['fields']['fieldsetcss'] = [ + 'type' => 'fieldset', + 'legend' => Translations::translate('Custom CSS'), + 'fields' => [ + 'customcss' => [ + 'type' => 'codearea', + 'label' => Translations::translate('Add your individual CSS'), + 'class' => 'codearea', + 'description' => Translations::translate('You can overwrite the theme-css with your own css here.') + ] ] - ] - ]; + ]; - $themeSettings['preview'] = '/themes/' . $themeName . '/' . $themeName . '.png'; + $themeSettings['preview'] = '/themes/' . $themeName . '/' . $themeName . '.png'; + } return $themeSettings; }