Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Correctly create the template object in BaseTemplate::insert() (see #…
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Oct 21, 2014
1 parent c35d1e4 commit da65d49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions system/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Contao Open Source CMS changelog
Version 3.3.6 (2014-XX-XX)
--------------------------

### Fixed
Correctly create a template object in `BaseTemplate::insert()` (see #7366).

### Updated
Updated TinyMCE to version 4.1.6 and added the "lists" plugin (see #7349).

Expand Down
13 changes: 12 additions & 1 deletion system/modules/core/library/Contao/BaseTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,18 @@ public function endblock()
*/
public function insert($name, array $data=null)
{
$tpl = new static($name);
if ($this instanceof \Template)
{
$tpl = new static($name);
}
elseif (TL_MODE == 'BE')
{
$tpl = new \BackendTemplate($name);
}
else
{
$tpl = new \FrontendTemplate($name);
}

if ($data !== null)
{
Expand Down

0 comments on commit da65d49

Please sign in to comment.