From cdee9fa1fa464530bdfcca3d6661078ec032ba8a Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Sun, 10 Jan 2016 14:59:09 +0100 Subject: [PATCH] Avoid adding the onTwigTemplatePaths if it's not enabled on this page --- comments.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/comments.php b/comments.php index 743971d..49be739 100644 --- a/comments.php +++ b/comments.php @@ -103,12 +103,13 @@ class CommentsPlugin extends Plugin $this->calculateEnable(); - $this->enable([ - 'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0], - ]); + if ($this->enable) { + $this->enable([ + 'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0], + ]); + } } else { - /** @var Uri $uri */ $uri = $this->grav['uri'];