diff --git a/controllers/front/ajax.php b/controllers/front/ajax.php index 984b06a6..ef499ac7 100644 --- a/controllers/front/ajax.php +++ b/controllers/front/ajax.php @@ -271,12 +271,14 @@ public function displayAjaxduplicateState() 'id_shop', 'id_lang', 'position', + 'instance_id', ]; foreach ($excludedProperties as $property) { unset($originalValues[$property]); } $newBlock = new PrettyBlocksModel(); $newBlock->hydrate($originalValues); + $newBlock->instance_id = uniqid(); $newBlock->id_shop = $idShop; $newBlock->id_lang = (int) $language; $newBlock->add(); diff --git a/prettyblocks.php b/prettyblocks.php index 8f45520f..f366dd68 100755 --- a/prettyblocks.php +++ b/prettyblocks.php @@ -1,5 +1,4 @@ _addDynamicZones(); if ((isset($_SERVER['HTTP_SEC_FETCH_DEST']) && $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe') || Tools::getValue('prettyblocks') === '1') { + // Mode édition (iframe du builder) : build.js neutralise TOUS les liens de la page + // (preventDefault + postMessage vers le BO). Cette condition se déclenche sur le seul + // en-tête Sec-Fetch-Dest, que LiteSpeed ne prend pas en compte dans sa clé de cache : + // sans ceci, la page rendue pour l'iframe est mise en cache public et servie à tous + // les visiteurs, chez qui plus aucun lien ne répond au clic (incident maisonaveni, 23/10/2026). + Hook::exec('litespeedNotCacheable', ['reason' => 'PrettyBlocks edit mode', 'from' => 'prettyblocks']); $this->context->controller->registerJavascript( 'prettyblocks', 'modules/' . $this->name . '/views/js/build/build.js',