Skip to content

Commit

Permalink
Error in resolving site rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ryssbowh committed Jun 8, 2021
1 parent 68f8b35 commit 6455b9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/services/ThemesRules.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ 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) {
if (!$rule['enabled']) {
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);
}
}
Expand Down

0 comments on commit 6455b9c

Please sign in to comment.