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