Skip to content

Commit 68f8b35

Browse files
committed
Twig extension error in control panel
1 parent 62dbb55 commit 68f8b35

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# ryssbowh/craft-themes Changelog
22

3+
## 2.1.1 - 2021-05-10
4+
5+
### Fixed
6+
- Twig extension error in control panel
7+
38
## 2.1.0 - 2021-05-08
49

510
### Changed

src/Themes.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function init()
5353
]
5454
]);
5555

56+
Craft::$app->view->registerTwigExtension(new TwigTheme);
57+
5658
Event::on(ClearCaches::class, ClearCaches::EVENT_REGISTER_CACHE_OPTIONS,
5759
function (RegisterCacheOptionsEvent $event) {
5860
$event->options[] = [
@@ -115,7 +117,6 @@ protected function resolveTheme(RegisterTemplateRootsEvent $event)
115117

116118
\Yii::setAlias('@themePath', '@root/themes/' . $theme->handle);
117119
\Yii::setAlias('@themeWebPath', '@webroot/themes/' . $theme->handle);
118-
Craft::$app->view->registerTwigExtension(new TwigTheme);
119120
$event->roots[''] = array_merge($theme->getTemplatePaths(), $event->roots[''] ?? []);
120121
$path = \Craft::$app->request->getPathInfo();
121122
$theme->registerAssetBundles($path);

0 commit comments

Comments
 (0)