From 6455b9cd8e38db31656bce52fff792a4d133fbc6 Mon Sep 17 00:00:00 2001 From: Boris Blondin Date: Tue, 8 Jun 2021 10:04:53 +0100 Subject: [PATCH] Error in resolving site rules --- CHANGELOG.md | 5 +++++ src/services/ThemesRules.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4c733f8..9bbb145a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # ryssbowh/craft-themes Changelog +## 2.1.2 - 2021-06-08 + +### Fixed +- Error in resolving site rules + ## 2.1.1 - 2021-05-10 ### Fixed diff --git a/src/services/ThemesRules.php b/src/services/ThemesRules.php index 62dab288..e3812ac9 100644 --- a/src/services/ThemesRules.php +++ b/src/services/ThemesRules.php @@ -88,7 +88,7 @@ public static function clearCaches() * * @return ?string */ - protected function resolveRules(string $path, Site $site, string $url): ?string + protected function resolveRules(string $path, Site $currentSite, string $url): ?string { $themeName = null; foreach ($this->rules as $rule) { @@ -96,8 +96,8 @@ protected function resolveRules(string $path, Site $site, string $url): ?string continue; } $site = $language = $url = false; - if ($site = $this->resolveSiteRule($rule['site'], $site)) { - if ($language = $this->resolveLanguageRule($rule['language'], $site->getLocale())) { + if ($site = $this->resolveSiteRule($rule['site'], $currentSite)) { + if ($language = $this->resolveLanguageRule($rule['language'], $currentSite->getLocale())) { $url = $this->resolvePathRule($rule['url'], $path); } }