From 947d32ec09a40f73abfb4483bf3bb68abe9f434a Mon Sep 17 00:00:00 2001 From: Sommerregen Date: Fri, 21 Aug 2015 21:34:10 +0200 Subject: [PATCH 1/2] :hotsprings: Bugfix - Add missing Twig update routines --- themer.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/themer.php b/themer.php index 31b5b00..8e20b51 100644 --- a/themer.php +++ b/themer.php @@ -21,6 +21,7 @@ use Grav\Common\Plugin; use Grav\Common\Page\Page; +use Grav\Common\Twig\TraceableTwigEnvironment; /** * ThemerPlugin @@ -77,6 +78,24 @@ public function onPageInitialized() // Reload themes to reflect changes $this->grav['themes']->init(); + + // Silent DebugBar error :: 'twig' is already a registered collector + if ($debug = $this->config->get('system.debugger.twig', false)) { + $this->config->set('system.debugger.twig', false); + } + + // Reset and re-initialize Twig environment + $twig = $this->grav['twig']; + $twig->twig = null; + $twig->twig_paths = []; + $twig->init(); + + // Update TwigCollector for DebugBar + if ($debug) { + $twig->twig = new TraceableTwigEnvironment($twig->twig); + $collector = $this->grav['debugger']->getCollector('twig'); + $collector->twig = $twig->twig; + } } } } From d32886e9668531dcc1c8a6ad51850cc327422032 Mon Sep 17 00:00:00 2001 From: Sommerregen Date: Fri, 21 Aug 2015 21:36:03 +0200 Subject: [PATCH 2/2] :maple_leaf: Version Update - Release v1.0.1 --- CHANGELOG.md | 6 ++++++ blueprints.yaml | 2 +- themer.php | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b9145..e0c33ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.0.1 +## 08/21/2015 + +3. [](#bugfix) + * Fixed missing Twig update routines + # v1.0.0 ## 08/20/2015 diff --git a/blueprints.yaml b/blueprints.yaml index c46b37c..ac96f7c 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Themer -version: 1.0.0 +version: 1.0.1 description: "This plugin enables you to use different themes on one site individual set per page or collection." icon: magic author: diff --git a/themer.php b/themer.php index 8e20b51..4a6384c 100644 --- a/themer.php +++ b/themer.php @@ -1,6 +1,6 @@ * @author Benjamin Regler * @copyright 2015, Benjamin Regler