diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php index c5279bff6b..a362b581fe 100644 --- a/lib/private/legacy/template.php +++ b/lib/private/legacy/template.php @@ -206,6 +206,12 @@ class OC_Template extends \OC\Template\Base { if( $this->renderAs ) { $page = new TemplateLayout($this->renderAs, $this->app); + if(is_array($additionalParams)) { + foreach ($additionalParams as $key => $value) { + $page->assign($key, $value); + } + } + // Add custom headers $headers = ''; foreach(OC_Util::$headers as $header) { @@ -226,7 +232,7 @@ class OC_Template extends \OC\Template\Base { $page->assign('headers', $headers); $page->assign('content', $data); - return $page->fetchPage(); + return $page->fetchPage($additionalParams); } return $data; diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php index ccb0c61bfd..0e31f780d7 100644 --- a/lib/public/AppFramework/Http/TemplateResponse.php +++ b/lib/public/AppFramework/Http/TemplateResponse.php @@ -154,7 +154,7 @@ class TemplateResponse extends Response { $template->assign($key, $value); } - return $template->fetchPage(); + return $template->fetchPage($this->params); } }