Skip to content

Commit

Permalink
fix baserproject#2987 BcBaserHelper::getThemeUrl()でサブサイトに設定しているテーマURL…
Browse files Browse the repository at this point in the history
…が取得できない動作を修正
  • Loading branch information
fuchigam1 committed Dec 25, 2023
1 parent 34ac3cd commit 4476f8d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions lib/Baser/Test/Case/View/Helper/BcBaserHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1967,6 +1967,12 @@ public function testGetThemeUrl()
$this->siteConfig['theme'] = 'nada-icons';
$expects = $this->BcBaser->request->webroot . 'theme' . '/' . $this->siteConfig['theme'] . '/';
$this->assertEquals($expects, $this->BcBaser->getThemeUrl());

if (!empty($this->BcBaser->request->params['Site']['theme'])) {
$theme = $this->BcBaser->request->params['Site']['theme'];
}
$expects = $this->BcBaser->request->webroot . 'theme' . '/' . $theme . '/';
$this->assertEquals($expects, $this->BcBaser->getThemeUrl());
}

/**
Expand Down
6 changes: 5 additions & 1 deletion lib/Baser/View/Helper/BcBaserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2454,7 +2454,11 @@ public function getThemeImage($name, $options = [])
*/
public function getThemeUrl()
{
return $this->request->webroot . 'theme' . '/' . $this->siteConfig['theme'] . '/';
$theme = $this->siteConfig['theme'];
if ($this->theme) {
$theme = $this->theme;
}
return $this->request->webroot . 'theme' . DS . $theme . DS;
}

/**
Expand Down

0 comments on commit 4476f8d

Please sign in to comment.