From c52ca27126f11ba9bb32bf0cf509f2aedca18d24 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 9 Jan 2025 15:41:22 +0100 Subject: [PATCH] Fix if someone deletes the default kathrine template --- system/settings.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/settings.php b/system/settings.php index 89028cf7..0d447c0f 100644 --- a/system/settings.php +++ b/system/settings.php @@ -11,8 +11,14 @@ * - for number: min, max, step */ +use MyAAC\Cache; use MyAAC\Settings; +$templates = Cache::remember('templates', 5 * 60, function () { + return get_templates(); +}); +$defaultTemplate = in_array('kathrine', $templates) ? 'kathrine' : $templates[0]; + return [ 'name' => 'MyAAC', 'settings' => [ @@ -88,7 +94,7 @@ return [ 'type' => 'options', 'options' => '$templates', 'desc' => 'Name of the template used by website', - 'default' => 'kathrine', + 'default' => $defaultTemplate, ], 'template_allow_change' => [ 'name' => 'Template Allow Change',