From a15952c13c3f4a2384e6840a02d69d4cdd97ece7 Mon Sep 17 00:00:00 2001 From: mgielecinski Date: Tue, 27 Jan 2026 23:48:37 +0100 Subject: [PATCH 1/6] fix init grade stars in comment list header --- views/js/list-comments.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/views/js/list-comments.js b/views/js/list-comments.js index 297f1164..f0e9e13f 100644 --- a/views/js/list-comments.js +++ b/views/js/list-comments.js @@ -39,6 +39,7 @@ jQuery(document).ready(function () { const nextCount = totalPages + 1; const gapText = '…'; + $('#product-comments-list-header .grade-stars').rating(); $('#product-comments-list .grade-stars').rating(); $('.product-comments-additional-info .grade-stars').rating(); @@ -47,6 +48,7 @@ jQuery(document).ready(function () { }) document.addEventListener('updateRating', function() { + $('#product-comments-list-header .grade-stars').rating(); $('#product-comments-list .grade-stars').rating(); $('.product-comments-additional-info .grade-stars').rating(); }); From 415971cb6840979d386d58710c511a075b45d407 Mon Sep 17 00:00:00 2001 From: Metin EREN Date: Wed, 15 Apr 2026 17:25:01 +0300 Subject: [PATCH 2/6] Update ProductCommentRepository.php Fixes #226 issue $productIds parameter array causes an error because it is not sorted. --- src/Repository/ProductCommentRepository.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Repository/ProductCommentRepository.php b/src/Repository/ProductCommentRepository.php index 88db9688..4e60cb7e 100644 --- a/src/Repository/ProductCommentRepository.php +++ b/src/Repository/ProductCommentRepository.php @@ -307,6 +307,7 @@ public function getAverageGrades(array $productIds, $validatedOnly) $sql = 'SELECT'; $count = count($productIds); + $productIds = array_values($productIds); foreach ($productIds as $index => $id) { $esqID = (int) $id; @@ -372,6 +373,7 @@ public function getCommentsNumberForProducts(array $productIds, $validatedOnly) $sql = 'SELECT'; $count = count($productIds); + $productIds = array_values($productIds); foreach ($productIds as $index => $id) { $esqID = (int) $id; From 7088a72dea57d4780a20fbc2f7e81a8693d371a5 Mon Sep 17 00:00:00 2001 From: Audrius Date: Mon, 10 Aug 2026 02:28:11 +0200 Subject: [PATCH 3/6] Delete the rows referencing a comment before the comment --- src/Repository/ProductCommentRepository.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Repository/ProductCommentRepository.php b/src/Repository/ProductCommentRepository.php index 0292723a..913d55f7 100644 --- a/src/Repository/ProductCommentRepository.php +++ b/src/Repository/ProductCommentRepository.php @@ -107,11 +107,14 @@ public function delete(ProductComment $entity): void { $entityId = $entity->getId(); - $this->remove($entity, true); - + // The rows below reference the comment, so they have to go first. Without the foreign keys the + // order does not matter, but a shop that applied the schema this module declares does have them, + // and removing the comment first fails with "Cannot delete or update a parent row". $this->deleteGrades($entityId); $this->deleteReports($entityId); $this->deleteUsefulness($entityId); + + $this->remove($entity, true); } /** From a725d0311b65b1a501c2712010db0a07c4cc4e07 Mon Sep 17 00:00:00 2001 From: Thomas N Date: Wed, 9 Sep 2026 17:24:02 +0100 Subject: [PATCH 4/6] Bump to v9.0.1 --- config.xml | 2 +- productcomments.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.xml b/config.xml index ba407583..4380d5fc 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ productcomments - + diff --git a/productcomments.php b/productcomments.php index 875f40d7..816a2fdd 100644 --- a/productcomments.php +++ b/productcomments.php @@ -67,7 +67,7 @@ public function __construct() { $this->name = 'productcomments'; $this->tab = 'front_office_features'; - $this->version = '9.0.0'; + $this->version = '9.0.1'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->bootstrap = true; From 3d31fcc66e7d4a39be2a9d12bd12220ae49c0f04 Mon Sep 17 00:00:00 2001 From: Thomas N Date: Wed, 9 Sep 2026 17:28:52 +0100 Subject: [PATCH 5/6] Apply cs fixer --- src/Repository/ProductCommentRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Repository/ProductCommentRepository.php b/src/Repository/ProductCommentRepository.php index 477dcbf9..75ae8738 100644 --- a/src/Repository/ProductCommentRepository.php +++ b/src/Repository/ProductCommentRepository.php @@ -305,7 +305,7 @@ public function getAverageGrades(array $productIds, $validatedOnly) $sql = 'SELECT'; $count = count($productIds); - $productIds = array_values($productIds); + $productIds = array_values($productIds); foreach ($productIds as $index => $id) { $esqID = (int) $id; @@ -371,7 +371,7 @@ public function getCommentsNumberForProducts(array $productIds, $validatedOnly) $sql = 'SELECT'; $count = count($productIds); - $productIds = array_values($productIds); + $productIds = array_values($productIds); foreach ($productIds as $index => $id) { $esqID = (int) $id; From a3500d8d790f6d1193bbc1d7a6777a1e9dfa8272 Mon Sep 17 00:00:00 2001 From: Thomas N Date: Wed, 9 Sep 2026 17:35:12 +0100 Subject: [PATCH 6/6] Add the product key needed to upload releases on the marketplace --- productcomments.php | 1 + 1 file changed, 1 insertion(+) diff --git a/productcomments.php b/productcomments.php index 875f40d7..007ad8a5 100644 --- a/productcomments.php +++ b/productcomments.php @@ -71,6 +71,7 @@ public function __construct() $this->author = 'PrestaShop'; $this->need_instance = 0; $this->bootstrap = true; + $this->module_key = 'e699ddd0ac2d61593ec594e82b719da6'; parent::__construct();