Fixed exception if module content is empty
This commit is contained in:
@@ -53,7 +53,11 @@ class Module extends AbstractSmartyPlugin
|
||||
}
|
||||
}
|
||||
}
|
||||
return $template->fetch(sprintf("string:%s", $content));
|
||||
|
||||
if (! empty($content))
|
||||
return $template->fetch(sprintf("string:%s", $content));
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -155,6 +155,7 @@ class FormatTest extends \PHPUnit_Framework_TestCase
|
||||
* test formatDate without mandatory parameters
|
||||
*
|
||||
* @covers ::formatDate
|
||||
* @expectedException Thelia\Core\Template\Smarty\Exception\SmartyPluginException
|
||||
*/
|
||||
public function testFormatDateWithoutDate()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapse-{$LOOP_COUNT}">
|
||||
{$TITLE|strip_tags nofilter} - {format_date timestamp=$DATE}
|
||||
{$TITLE|strip_tags nofilter} - {format_date timestamp=$DATE output='date'}
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user