Skip to content

Commit

Permalink
Do not register bundles for cp requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryssbowh committed Aug 17, 2021
1 parent ee5652a commit f75f015
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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.5 - 2021-08-17

### Fixed
- Do not register bundles for cp requests

## 2.1.4 - 2021-07-14

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/Themes.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ protected function resolveTheme(RegisterTemplateRootsEvent $event)
\Yii::setAlias('@themePath', '@root/themes/' . $theme->handle);
\Yii::setAlias('@themeWebPath', '@webroot/themes/' . $theme->handle);
$event->roots[''] = array_merge($theme->getTemplatePaths(), $event->roots[''] ?? []);
if (\Craft::$app->request instanceof Request) {
if (\Craft::$app->request instanceof Request and \Craft::$app->request->isSiteRequest) {
$path = \Craft::$app->request->getPathInfo();
$theme->registerAssetBundles($path);
}
Expand Down

0 comments on commit f75f015

Please sign in to comment.