diff --git a/config.xml b/config.xml index 958f4458..74be0518 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ productcomments - + diff --git a/productcomments.php b/productcomments.php index 851d063c..62984425 100644 --- a/productcomments.php +++ b/productcomments.php @@ -47,7 +47,7 @@ public function __construct() { $this->name = 'productcomments'; $this->tab = 'front_office_features'; - $this->version = '8.0.0'; + $this->version = '8.0.1'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->bootstrap = true; diff --git a/src/Repository/ProductCommentCriterionRepository.php b/src/Repository/ProductCommentCriterionRepository.php index 6b142af2..4a0e51f5 100644 --- a/src/Repository/ProductCommentCriterionRepository.php +++ b/src/Repository/ProductCommentCriterionRepository.php @@ -159,12 +159,13 @@ public function update(ProductCommentCriterion $criterion): int private function updateCategories($criterion): int { $res = 0; - $criterionId = $criterion->getId(); + $criterionId = (int) $criterion->getId(); foreach ($criterion->getCategories() as $id_category) { $res += $this->connection->executeUpdate( 'INSERT INTO `' . _DB_PREFIX_ . 'product_comment_criterion_category` (`id_product_comment_criterion`, `id_category`) - VALUES(' . $criterionId . ',' . $id_category . ')' + VALUES(?, ?)', + [$criterionId, (int) $id_category] ); } @@ -174,12 +175,13 @@ private function updateCategories($criterion): int private function updateProducts($criterion): int { $res = 0; - $criterionId = $criterion->getId(); + $criterionId = (int) $criterion->getId(); foreach ($criterion->getProducts() as $id_product) { $res += $this->connection->executeUpdate( 'INSERT INTO `' . _DB_PREFIX_ . 'product_comment_criterion_product` (`id_product_comment_criterion`, `id_product`) - VALUES(' . $criterionId . ',' . $id_product . ')' + VALUES(?, ?)', + [$criterionId, (int) $id_product] ); }