diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php
index a66a1ed03..77715cad6 100644
--- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php
+++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Module.php
@@ -63,7 +63,7 @@ class Module extends AbstractSmartyPlugin
public function theliaModule($params, \Smarty_Internal_Template $template)
{
$content = null;
-
+ $count = 0;
if (false !== $location = $this->getParam($params, 'location', false)) {
if ($this->debug === true && $this->request->get('SHOW_INCLUDE')) {
@@ -74,8 +74,6 @@ class Module extends AbstractSmartyPlugin
$modules = ModuleQuery::getActivated();
- $count = 0;
-
foreach ($modules as $module) {
if (null !== $moduleLimit && $moduleLimit != $module->getCode()) {
@@ -92,14 +90,14 @@ class Module extends AbstractSmartyPlugin
}
}
- if (! empty($content)) {
- return $template->fetch(sprintf("string:%s", $content));
- }
-
if (false !== $countvarname = $this->getParam($params, 'countvar', false)) {
$template->assign($countvarname, $count);
}
+ if (! empty($content)) {
+ return $template->fetch(sprintf("string:%s", $content));
+ }
+
return "";
}
diff --git a/templates/backOffice/default/category-edit.html b/templates/backOffice/default/category-edit.html
index 8f3fc4e40..02e48bc63 100644
--- a/templates/backOffice/default/category-edit.html
+++ b/templates/backOffice/default/category-edit.html
@@ -273,7 +273,7 @@
{module_include location='category-edit' countvar='module_count'}
- {if $countvar == 0}
+ {if $module_count == 0}
{intl l="There is currently no active module here."}
diff --git a/templates/backOffice/default/content-edit.html b/templates/backOffice/default/content-edit.html
index 49c8f6b66..3c238b8da 100644
--- a/templates/backOffice/default/content-edit.html
+++ b/templates/backOffice/default/content-edit.html
@@ -168,7 +168,7 @@
{module_include location='content-edit' countvar='module_count'}
- {if $countvar == 0}
+ {if $module_count == 0}
{intl l="There is currently no active module here."}
diff --git a/templates/backOffice/default/folder-edit.html b/templates/backOffice/default/folder-edit.html
index bff41f094..3d627dfce 100644
--- a/templates/backOffice/default/folder-edit.html
+++ b/templates/backOffice/default/folder-edit.html
@@ -154,7 +154,7 @@
{module_include location='folder-edit' countvar='module_count'}
- {if $countvar == 0}
+ {if $module_count == 0}
{intl l="There is currently no active module here."}
diff --git a/templates/backOffice/default/order-edit.html b/templates/backOffice/default/order-edit.html
index b7a134079..3a50b6e1c 100644
--- a/templates/backOffice/default/order-edit.html
+++ b/templates/backOffice/default/order-edit.html
@@ -353,7 +353,7 @@
{module_include location='order-edit' countvar='module_count'}
- {if $countvar == 0}
+ {if $module_count == 0}
{intl l="There is currently no active module here."}
diff --git a/templates/backOffice/default/product-edit.html b/templates/backOffice/default/product-edit.html
index 0eb56fed4..21e50dab8 100644
--- a/templates/backOffice/default/product-edit.html
+++ b/templates/backOffice/default/product-edit.html
@@ -121,7 +121,7 @@
{module_include location='product-edit' countvar='module_count'}
- {if $countvar == 0}
+ {if $module_count == 0}
{intl l="There is currently no active module here."}