From b0e0ee565b6005615a6c4eb4cbeb1e6df8ff2ccc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaime=20Pe=CC=81rez=20Crespo?= <jaime.perez@uninett.no>
Date: Thu, 3 Aug 2017 15:15:48 +0200
Subject: [PATCH] If we are using a theme, make sure its template directory is
 avaiilable to Twig.

Otherwise, a theme would not be able to include/embed/extend its own templates.
---
 lib/SimpleSAML/XHTML/Template.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 38a8066c3..77a07c649 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -172,6 +172,9 @@ class SimpleSAML_XHTML_Template
         if ($this->module) {
             $templateDirs[] = array($this->module => $this->getModuleTemplateDir($this->module));
         }
+        if ($this->theme['module']) {
+            $templateDirs[] = array($this->theme['module'] => $this->getModuleTemplateDir($this->theme['module']));
+        }
 
         // default, themeless templates are checked last
         $templateDirs[] = array(
-- 
GitLab