File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22<module >
33 <name >productcomments</name >
44 <displayName ><![CDATA[ Product Comments]]> </displayName >
5- <version ><![CDATA[ 8.0.0 ]]> </version >
5+ <version ><![CDATA[ 8.0.1 ]]> </version >
66 <description ><![CDATA[ Allows users to post reviews and rate products on specific criteria.]]> </description >
77 <author ><![CDATA[ PrestaShop]]> </author >
88 <tab ><![CDATA[ front_office_features]]> </tab >
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ public function __construct()
4747 {
4848 $ this ->name = 'productcomments ' ;
4949 $ this ->tab = 'front_office_features ' ;
50- $ this ->version = '8.0.0 ' ;
50+ $ this ->version = '8.0.1 ' ;
5151 $ this ->author = 'PrestaShop ' ;
5252 $ this ->need_instance = 0 ;
5353 $ this ->bootstrap = true ;
Original file line number Diff line number Diff line change @@ -159,12 +159,13 @@ public function update(ProductCommentCriterion $criterion): int
159159 private function updateCategories ($ criterion ): int
160160 {
161161 $ res = 0 ;
162- $ criterionId = $ criterion ->getId ();
162+ $ criterionId = ( int ) $ criterion ->getId ();
163163 foreach ($ criterion ->getCategories () as $ id_category ) {
164164 $ res += $ this ->connection ->executeUpdate (
165165 'INSERT INTO ` ' .
166166 _DB_PREFIX_ . 'product_comment_criterion_category` (`id_product_comment_criterion`, `id_category`)
167- VALUES( ' . $ criterionId . ', ' . $ id_category . ') '
167+ VALUES(?, ?) ' ,
168+ [$ criterionId , (int ) $ id_category ]
168169 );
169170 }
170171
@@ -174,12 +175,13 @@ private function updateCategories($criterion): int
174175 private function updateProducts ($ criterion ): int
175176 {
176177 $ res = 0 ;
177- $ criterionId = $ criterion ->getId ();
178+ $ criterionId = ( int ) $ criterion ->getId ();
178179 foreach ($ criterion ->getProducts () as $ id_product ) {
179180 $ res += $ this ->connection ->executeUpdate (
180181 'INSERT INTO ` ' .
181182 _DB_PREFIX_ . 'product_comment_criterion_product` (`id_product_comment_criterion`, `id_product`)
182- VALUES( ' . $ criterionId . ', ' . $ id_product . ') '
183+ VALUES(?, ?) ' ,
184+ [$ criterionId , (int ) $ id_product ]
183185 );
184186 }
185187
You can’t perform that action at this time.
0 commit comments