Skip to content

Commit

Permalink
Correctly fix contao/core-bundle#1438
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Sep 7, 2019
1 parent 28e4051 commit 1e02bb0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/dca/tl_content.php
Expand Up @@ -552,7 +552,7 @@
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('tl_content', 'getGalleryTemplates'),
'eval' => array('tl_class'=>'w50'),
'eval' => array('includeBlankOption'=>true, 'chosen'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'customTpl' => array
Expand Down
6 changes: 3 additions & 3 deletions core-bundle/src/Resources/contao/dca/tl_module.php
Expand Up @@ -224,7 +224,7 @@
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('tl_module', 'getNavigationTemplates'),
'eval' => array('tl_class'=>'w50'),
'eval' => array('includeBlankOption'=>true, 'chosen'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'customTpl' => array
Expand Down Expand Up @@ -301,7 +301,7 @@
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('tl_module', 'getMemberTemplates'),
'eval' => array('tl_class'=>'w50'),
'eval' => array('includeBlankOption'=>true, 'chosen'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'form' => array
Expand Down Expand Up @@ -365,7 +365,7 @@
'exclude' => true,
'inputType' => 'select',
'options_callback' => array('tl_module', 'getSearchTemplates'),
'eval' => array('tl_class'=>'w50'),
'eval' => array('includeBlankOption'=>true, 'chosen'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
),
'inColumn' => array
Expand Down
10 changes: 4 additions & 6 deletions core-bundle/src/Resources/contao/elements/ContentGallery.php
Expand Up @@ -316,15 +316,13 @@ protected function compile()
++$rowcount;
}

$strTemplate = 'gallery_default';

// Use a custom template
if (TL_MODE == 'FE' && $this->galleryTpl != '')
// Set the default template
if ($this->galleryTpl == '')
{
$strTemplate = $this->galleryTpl;
$this->galleryTpl = 'gallery_default';
}

$objTemplate = new FrontendTemplate($strTemplate);
$objTemplate = new FrontendTemplate($this->galleryTpl);
$objTemplate->setData($this->arrData);
$objTemplate->body = $body;
$objTemplate->headline = $this->headline; // see #1603
Expand Down
2 changes: 1 addition & 1 deletion core-bundle/src/Resources/contao/modules/Module.php
Expand Up @@ -141,7 +141,7 @@ public function __construct($objModule, $strColumn='main')
$this->arrData = $objModule->row();
$this->cssID = StringUtil::deserialize($objModule->cssID, true);

if ($this->customTpl != '' && TL_MODE == 'FE')
if ($this->customTpl != '')
{
$this->strTemplate = $this->customTpl;
}
Expand Down
6 changes: 6 additions & 0 deletions core-bundle/src/Resources/contao/modules/ModuleSearch.php
Expand Up @@ -263,6 +263,12 @@ protected function compile()

list($contextLength, $totalLength) = StringUtil::deserialize($this->contextLength);

// Set the default template
if ($this->searchTpl == '')
{
$this->searchTpl = 'search_default';
}

// Get the results
for ($i=($from-1); $i<$to && $i<$count; $i++)
{
Expand Down

0 comments on commit 1e02bb0

Please sign in to comment.