diff --git a/classes/PrettyBlocksModel.php b/classes/PrettyBlocksModel.php index 0639ac6..87b42ec 100644 --- a/classes/PrettyBlocksModel.php +++ b/classes/PrettyBlocksModel.php @@ -153,10 +153,8 @@ public static function getInstanceByZone($zone_name, $context = 'back', $id_lang $blocks = []; foreach ($psc->getResults() as $res) { if ($res) { - $block = $res->mergeStateWithFields(); - if ($context == 'front') { - $block = (new BlockPresenter())->present($res->mergeStateWithFields($id_lang)); - } + $block = $res->mergeStateWithFields($context === 'front' ? $id_lang : null); + $block = $context === 'front' ? (new BlockPresenter())->present($block) : $block; $blocks[] = $block; } }