Fixed exception if module content is empty

This commit is contained in:
Franck Allimant
2013-10-30 20:10:37 +01:00
parent d1c54ea62a
commit a06d83bfb4
3 changed files with 7 additions and 2 deletions

View File

@@ -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 "";
}
/**

View File

@@ -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()
{

View File

@@ -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>