From d4fb0d37c29f2ab01c5c2444bbfa8b9e816c0b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 27 Oct 2024 21:44:59 +0100 Subject: [PATCH 1/2] Fix notice --- .../Platform/Modules/Sites/Http/Sites/GetTemplate.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Sites/Http/Sites/GetTemplate.php b/src/Appwrite/Platform/Modules/Sites/Http/Sites/GetTemplate.php index 56277fb7d3..f424d5ff0e 100644 --- a/src/Appwrite/Platform/Modules/Sites/Http/Sites/GetTemplate.php +++ b/src/Appwrite/Platform/Modules/Sites/Http/Sites/GetTemplate.php @@ -44,9 +44,10 @@ class GetTemplate extends Base { $templates = Config::getParam('site-templates', []); - $template = array_shift(\array_filter($templates, function ($item) use ($templateId) { + $allowedTemplates = \array_filter($templates, function ($item) use ($templateId) { return $item['id'] === $templateId; - })); + }); + $template = array_shift($allowedTemplates); if (empty($template)) { throw new Exception(Exception::SITE_TEMPLATE_NOT_FOUND); From 34fd22e4e90181fab2b3bf3e9f7becb05b0b2d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Sun, 27 Oct 2024 21:49:44 +0100 Subject: [PATCH 2/2] Fix unwanted object instead of array --- app/config/site-templates.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config/site-templates.php b/app/config/site-templates.php index 1d9821bb46..a406dc51c2 100644 --- a/app/config/site-templates.php +++ b/app/config/site-templates.php @@ -23,7 +23,7 @@ return [ 'name' => 'Personal portfolio', 'useCases' => ['starter'], 'frameworks' => [ - ...getFramework('SVELTEKIT', [ + getFramework('SVELTEKIT', [ 'serveRuntime' => 'static-1', 'installCommand' => 'npm install --force', 'providerRootDirectory' => './'