Skip to content

Commit

Permalink
API Ensure themelist returns an array
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Nov 15, 2024
1 parent 1a31282 commit 6937a2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Extensions/SiteTreeSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ public static function contentcontrollerInit($controller)
$subsite = Subsite::currentSubsite();

if ($subsite && $subsite->Theme) {
SSViewer::set_themes(ThemeResolver::singleton()->getThemeList($subsite));
$themeList = ThemeResolver::singleton()->getThemeList($subsite);
SSViewer::set_themes($themeList);
}

$ignore_subsite_locale = Config::inst()->get(SiteTreeSubsites::class, 'ignore_subsite_locale');
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ThemeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ThemeResolver
* @param Subsite $site
* @return array
*/
public function getThemeList(Subsite $site)
public function getThemeList(Subsite $site): array
{
$themes = array_values(SSViewer::get_themes() ?? []);
$siteTheme = $site->Theme;
Expand Down

0 comments on commit 6937a2d

Please sign in to comment.