From c558fa13f4f9124c55454e7263d059f5b40f0773 Mon Sep 17 00:00:00 2001 From: Pierre RAMBAUD Date: Wed, 9 Dec 2020 15:06:08 +0100 Subject: [PATCH 01/17] Use the correct version of php-cs-fixer --- .github/workflows/php.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index b5d13ec1..c5281bfa 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -26,8 +26,17 @@ jobs: - name: Checkout uses: actions/checkout@v2.0.0 + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: vendor + key: php-${{ hashFiles('composer.lock') }} + + - name: Install dependencies + run: composer install + - name: Run PHP-CS-Fixer - uses: prestashopcorp/github-action-php-cs-fixer@master + run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff # Run PHPStan against the module and a PrestaShop release phpstan: From 022dbcebd2f846c6ea8cefa43eb9a6bb3e4ba0e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Dec 2020 04:03:37 +0000 Subject: [PATCH 02/17] Bump prestashop/php-dev-tools from 3.11 to 3.12 Bumps [prestashop/php-dev-tools](https://github.com/PrestaShop/php-dev-tools) from 3.11 to 3.12. - [Release notes](https://github.com/PrestaShop/php-dev-tools/releases) - [Commits](https://github.com/PrestaShop/php-dev-tools/compare/v3.11...v3.12) Signed-off-by: dependabot[bot] --- composer.lock | 57 ++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/composer.lock b/composer.lock index b5f95289..6a591b7b 100644 --- a/composer.lock +++ b/composer.lock @@ -715,16 +715,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.16.5", + "version": "v2.17.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "38042b599a6ff03cf4559798a79792d724d1ebf4" + "reference": "5198b7308ed63f26799387fd7f3901c3db6bd7fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/38042b599a6ff03cf4559798a79792d724d1ebf4", - "reference": "38042b599a6ff03cf4559798a79792d724d1ebf4", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/5198b7308ed63f26799387fd7f3901c3db6bd7fd", + "reference": "5198b7308ed63f26799387fd7f3901c3db6bd7fd", "shasum": "" }, "require": { @@ -733,7 +733,7 @@ "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || ^7.0", + "php": "^5.6 || ^7.0 || ^8.0", "php-cs-fixer/diff": "^1.3", "symfony/console": "^3.4.43 || ^4.1.6 || ^5.0", "symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0", @@ -755,6 +755,7 @@ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", + "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", "symfony/phpunit-bridge": "^5.1", "symfony/yaml": "^3.0 || ^4.0 || ^5.0" @@ -808,7 +809,7 @@ "type": "github" } ], - "time": "2020-10-27T22:17:01+00:00" + "time": "2020-12-08T13:47:02+00:00" }, { "name": "nikic/php-parser", @@ -963,16 +964,16 @@ }, { "name": "prestashop/header-stamp", - "version": "v1.6", + "version": "v1.7", "source": { "type": "git", "url": "https://github.com/PrestaShopCorp/header-stamp.git", - "reference": "c13190c00594ea55f595b1b1c1dc832ecf4faaa0" + "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/c13190c00594ea55f595b1b1c1dc832ecf4faaa0", - "reference": "c13190c00594ea55f595b1b1c1dc832ecf4faaa0", + "url": "https://api.github.com/repos/PrestaShopCorp/header-stamp/zipball/d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", + "reference": "d77ce6d0a7f066670a4774be88f05e5f07b4b6fc", "shasum": "" }, "require": { @@ -1005,20 +1006,20 @@ ], "description": "Rewrite your file headers to add the license or to make them up-to-date", "homepage": "https://github.com/PrestaShopCorp/header-stamp", - "time": "2020-10-14T16:53:05+00:00" + "time": "2020-12-09T16:40:38+00:00" }, { "name": "prestashop/php-dev-tools", - "version": "v3.11", + "version": "v3.12", "source": { "type": "git", "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "4406828ed591e2d2bd03718a46fbdf888646fb65" + "reference": "4459c09fbe6116bb7c1c6cc54ce3ba3f4de65b62" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/4406828ed591e2d2bd03718a46fbdf888646fb65", - "reference": "4406828ed591e2d2bd03718a46fbdf888646fb65", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/4459c09fbe6116bb7c1c6cc54ce3ba3f4de65b62", + "reference": "4459c09fbe6116bb7c1c6cc54ce3ba3f4de65b62", "shasum": "" }, "require": { @@ -1043,7 +1044,7 @@ "MIT" ], "description": "PrestaShop coding standards", - "time": "2020-11-24T08:15:01+00:00" + "time": "2020-12-10T08:15:43+00:00" }, { "name": "psr/log", @@ -1145,7 +1146,7 @@ }, { "name": "symfony/console", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/console.git", @@ -1226,7 +1227,7 @@ }, { "name": "symfony/debug", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", @@ -1291,7 +1292,7 @@ }, { "name": "symfony/event-dispatcher", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", @@ -1364,7 +1365,7 @@ }, { "name": "symfony/filesystem", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", @@ -1423,16 +1424,16 @@ }, { "name": "symfony/finder", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4e1da3c110c52d868f8a9153b7de3ebc381fba78" + "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4e1da3c110c52d868f8a9153b7de3ebc381fba78", - "reference": "4e1da3c110c52d868f8a9153b7de3ebc381fba78", + "url": "https://api.github.com/repos/symfony/finder/zipball/b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", + "reference": "b6b6ad3db3edb1b4b1c1896b1975fb684994de6e", "shasum": "" }, "require": { @@ -1477,11 +1478,11 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2020-11-16T17:02:08+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", @@ -1847,7 +1848,7 @@ }, { "name": "symfony/process", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/process.git", @@ -1905,7 +1906,7 @@ }, { "name": "symfony/stopwatch", - "version": "v3.4.46", + "version": "v3.4.47", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", From f915d9312f96916292521a9f3aff1f4c68bb0ac3 Mon Sep 17 00:00:00 2001 From: Pierre RAMBAUD Date: Fri, 11 Dec 2020 11:10:33 +0100 Subject: [PATCH 03/17] Fix cs fixer --- ProductCommentCriterion.php | 10 +++++----- ProductCriterion.php | 16 ++++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ProductCommentCriterion.php b/ProductCommentCriterion.php index 3ede077a..7c400468 100644 --- a/ProductCommentCriterion.php +++ b/ProductCommentCriterion.php @@ -100,7 +100,7 @@ public function update($nullValues = false) public function addProduct($id_product) { if (!Validate::isUnsignedId($id_product)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->execute(' @@ -117,7 +117,7 @@ public function addProduct($id_product) public function addCategory($id_category) { if (!Validate::isUnsignedId($id_category)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->execute(' @@ -134,7 +134,7 @@ public function addCategory($id_category) public function addGrade($id_product_comment, $grade) { if (!Validate::isUnsignedId($id_product_comment)) { - die(Tools::displayError()); + exit(Tools::displayError()); } if ($grade < 0) { $grade = 0; @@ -159,7 +159,7 @@ public static function getByProduct($id_product, $id_lang) { if (!Validate::isUnsignedId($id_product) || !Validate::isUnsignedId($id_lang)) { - die(Tools::displayError()); + exit(Tools::displayError()); } $alias = 'p'; $table = ''; @@ -205,7 +205,7 @@ public static function getByProduct($id_product, $id_lang) public static function getCriterions($id_lang, $type = false, $active = false) { if (!Validate::isUnsignedId($id_lang)) { - die(Tools::displayError()); + exit(Tools::displayError()); } $sql = ' diff --git a/ProductCriterion.php b/ProductCriterion.php index d8c42df3..f9ce4f69 100644 --- a/ProductCriterion.php +++ b/ProductCriterion.php @@ -34,7 +34,7 @@ public static function add($id_lang, $name) { if (!Validate::isUnsignedId($id_lang) || !Validate::isMessage($name)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->execute(' @@ -53,7 +53,7 @@ public static function addToProduct($id_product_comment_criterion, $id_product) { if (!Validate::isUnsignedId($id_product_comment_criterion) || !Validate::isUnsignedId($id_product)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->execute(' @@ -72,7 +72,7 @@ public static function addGrade($id_product_comment, $id_product_comment_criteri { if (!Validate::isUnsignedId($id_product_comment) || !Validate::isUnsignedId($id_product_comment_criterion)) { - die(Tools::displayError()); + exit(Tools::displayError()); } if ($grade < 0) { $grade = 0; @@ -98,7 +98,7 @@ public static function update($id_product_comment_criterion, $id_lang, $name) if (!Validate::isUnsignedId($id_product_comment_criterion) || !Validate::isUnsignedId($id_lang) || !Validate::isMessage($name)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->execute(' @@ -117,7 +117,7 @@ public static function getByProduct($id_product, $id_lang) { if (!Validate::isUnsignedId($id_product) || !Validate::isUnsignedId($id_lang)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->executeS(' @@ -136,7 +136,7 @@ public static function getByProduct($id_product, $id_lang) public static function get($id_lang) { if (!Validate::isUnsignedId($id_lang)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->executeS(' @@ -154,7 +154,7 @@ public static function get($id_lang) public static function deleteByProduct($id_product) { if (!Validate::isUnsignedId($id_product)) { - die(Tools::displayError()); + exit(Tools::displayError()); } return Db::getInstance()->execute(' @@ -170,7 +170,7 @@ public static function deleteByProduct($id_product) public static function delete($id_product_comment_criterion) { if (!Validate::isUnsignedId($id_product_comment_criterion)) { - die(Tools::displayError()); + exit(Tools::displayError()); } $result = Db::getInstance()->execute(' DELETE FROM `' . _DB_PREFIX_ . 'product_comment_grade` From 9710c7ac2c1b34d4478850c08468e3b38da72ccb Mon Sep 17 00:00:00 2001 From: Oksydan Date: Tue, 15 Dec 2020 11:24:38 +0100 Subject: [PATCH 04/17] Check lastname existence before anonymising it --- controllers/front/ListComments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/front/ListComments.php b/controllers/front/ListComments.php index 04d8b764..52d94218 100644 --- a/controllers/front/ListComments.php +++ b/controllers/front/ListComments.php @@ -65,7 +65,7 @@ public function display() $productComment['content'] = htmlentities($productComment['content']); $productComment['date_add'] = $dateFormatter->format($dateAdd); - if ($isLastNameAnynomus) { + if ($isLastNameAnynomus && isset($productComment['lastname'])) { $productComment['lastname'] = substr($productComment['lastname'], 0, 1) . '.'; } From 2d6db31ff20dd5462a67cfb5fac14983264ca239 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 18 Dec 2020 17:05:59 +0100 Subject: [PATCH 05/17] Fixed PHPCS Github Action --- .github/workflows/php.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c5281bfa..7bb6a748 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -23,6 +23,11 @@ jobs: name: PHP-CS-Fixer runs-on: ubuntu-latest steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + - name: Checkout uses: actions/checkout@v2.0.0 From db5d0ed2e9e2a2632dc5733de20ab8daa1078935 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Dec 2020 04:16:18 +0000 Subject: [PATCH 06/17] Bump prestashop/php-dev-tools from 3.12 to 3.13 Bumps [prestashop/php-dev-tools](https://github.com/PrestaShop/php-dev-tools) from 3.12 to 3.13. - [Release notes](https://github.com/PrestaShop/php-dev-tools/releases) - [Commits](https://github.com/PrestaShop/php-dev-tools/compare/v3.12...v3.13) Signed-off-by: dependabot[bot] --- composer.lock | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/composer.lock b/composer.lock index 6a591b7b..9221238b 100644 --- a/composer.lock +++ b/composer.lock @@ -715,16 +715,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.17.1", + "version": "v2.17.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "5198b7308ed63f26799387fd7f3901c3db6bd7fd" + "reference": "aaee4f3d16a996fc0b570be0c69d3b80c909c507" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/5198b7308ed63f26799387fd7f3901c3db6bd7fd", - "reference": "5198b7308ed63f26799387fd7f3901c3db6bd7fd", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/aaee4f3d16a996fc0b570be0c69d3b80c909c507", + "reference": "aaee4f3d16a996fc0b570be0c69d3b80c909c507", "shasum": "" }, "require": { @@ -754,9 +754,11 @@ "php-cs-fixer/accessible-object": "^1.0", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.1", + "phpspec/prophecy-phpunit": "^1.1 || ^2.0", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.4.4 <9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", + "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", "symfony/phpunit-bridge": "^5.1", "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, @@ -809,7 +811,7 @@ "type": "github" } ], - "time": "2020-12-08T13:47:02+00:00" + "time": "2020-12-17T16:41:55+00:00" }, { "name": "nikic/php-parser", @@ -1010,16 +1012,16 @@ }, { "name": "prestashop/php-dev-tools", - "version": "v3.12", + "version": "v3.13", "source": { "type": "git", "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "4459c09fbe6116bb7c1c6cc54ce3ba3f4de65b62" + "reference": "a4d6a082bab49c4efce3d8cbb190bc500ff4204d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/4459c09fbe6116bb7c1c6cc54ce3ba3f4de65b62", - "reference": "4459c09fbe6116bb7c1c6cc54ce3ba3f4de65b62", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/a4d6a082bab49c4efce3d8cbb190bc500ff4204d", + "reference": "a4d6a082bab49c4efce3d8cbb190bc500ff4204d", "shasum": "" }, "require": { @@ -1044,7 +1046,7 @@ "MIT" ], "description": "PrestaShop coding standards", - "time": "2020-12-10T08:15:43+00:00" + "time": "2020-12-23T11:35:25+00:00" }, { "name": "psr/log", From fbc478bc380f7bcaf68d05f73cf70567b4fbcd50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Jan 2021 04:18:48 +0000 Subject: [PATCH 07/17] Bump prestashop/php-dev-tools from 3.13 to 3.14 Bumps [prestashop/php-dev-tools](https://github.com/PrestaShop/php-dev-tools) from 3.13 to 3.14. - [Release notes](https://github.com/PrestaShop/php-dev-tools/releases) - [Commits](https://github.com/PrestaShop/php-dev-tools/compare/v3.13...v3.14) Signed-off-by: dependabot[bot] --- composer.lock | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/composer.lock b/composer.lock index 9221238b..f17f08f5 100644 --- a/composer.lock +++ b/composer.lock @@ -715,16 +715,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.17.2", + "version": "v2.18.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "aaee4f3d16a996fc0b570be0c69d3b80c909c507" + "reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/aaee4f3d16a996fc0b570be0c69d3b80c909c507", - "reference": "aaee4f3d16a996fc0b570be0c69d3b80c909c507", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", + "reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", "shasum": "" }, "require": { @@ -746,20 +746,19 @@ "symfony/stopwatch": "^3.0 || ^4.0 || ^5.0" }, "require-dev": { - "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", "keradus/cli-executor": "^1.4", "mikey179/vfsstream": "^1.6", - "php-coveralls/php-coveralls": "^2.4.1", + "php-coveralls/php-coveralls": "^2.4.2", "php-cs-fixer/accessible-object": "^1.0", "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", "phpspec/prophecy-phpunit": "^1.1 || ^2.0", - "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.4.4 <9.5", + "phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.13 || ^9.5", "phpunitgoodpractices/polyfill": "^1.5", "phpunitgoodpractices/traits": "^1.9.1", "sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1", - "symfony/phpunit-bridge": "^5.1", + "symfony/phpunit-bridge": "^5.2.1", "symfony/yaml": "^3.0 || ^4.0 || ^5.0" }, "suggest": { @@ -811,7 +810,7 @@ "type": "github" } ], - "time": "2020-12-17T16:41:55+00:00" + "time": "2021-01-18T03:31:06+00:00" }, { "name": "nikic/php-parser", @@ -1012,16 +1011,16 @@ }, { "name": "prestashop/php-dev-tools", - "version": "v3.13", + "version": "v3.14", "source": { "type": "git", "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "a4d6a082bab49c4efce3d8cbb190bc500ff4204d" + "reference": "ef4217ee7212e6b65d983371b3255ca38395de44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/a4d6a082bab49c4efce3d8cbb190bc500ff4204d", - "reference": "a4d6a082bab49c4efce3d8cbb190bc500ff4204d", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/ef4217ee7212e6b65d983371b3255ca38395de44", + "reference": "ef4217ee7212e6b65d983371b3255ca38395de44", "shasum": "" }, "require": { @@ -1046,7 +1045,7 @@ "MIT" ], "description": "PrestaShop coding standards", - "time": "2020-12-23T11:35:25+00:00" + "time": "2021-01-18T15:07:05+00:00" }, { "name": "psr/log", From 260a29b63748e2bdb210c9d029d870d2d6e1d3a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 04:13:09 +0000 Subject: [PATCH 08/17] Bump simplePagination.js from `e32c66e` to `da97104` Bumps [simplePagination.js](https://github.com/flaviusmatis/simplePagination.js) from `e32c66e` to `da97104`. - [Release notes](https://github.com/flaviusmatis/simplePagination.js/releases) - [Commits](https://github.com/flaviusmatis/simplePagination.js/compare/e32c66e0f188d9ee022c1d2748de487fa9b77d58...da9710471a235dfea861401027c0adf5b45286fb) Signed-off-by: dependabot[bot] --- yarn.lock | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 42146766..84788fdf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,4 +4,5 @@ "simplePagination.js@https://github.com/flaviusmatis/simplePagination.js.git": version "0.0.0" - resolved "https://github.com/flaviusmatis/simplePagination.js.git#e32c66e0f188d9ee022c1d2748de487fa9b77d58" + uid da9710471a235dfea861401027c0adf5b45286fb + resolved "https://github.com/flaviusmatis/simplePagination.js.git#da9710471a235dfea861401027c0adf5b45286fb" From a3ee8b78dd15f2785ef353c2b8ed6bc8ce2fcfca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Mar 2021 04:02:07 +0000 Subject: [PATCH 09/17] Bump prestashop/php-dev-tools from 3.14 to 3.15 Bumps [prestashop/php-dev-tools](https://github.com/PrestaShop/php-dev-tools) from 3.14 to 3.15. - [Release notes](https://github.com/PrestaShop/php-dev-tools/releases) - [Commits](https://github.com/PrestaShop/php-dev-tools/compare/v3.14...v3.15) Signed-off-by: dependabot[bot] --- composer.lock | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/composer.lock b/composer.lock index f17f08f5..15180460 100644 --- a/composer.lock +++ b/composer.lock @@ -715,16 +715,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.18.0", + "version": "v2.18.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef" + "reference": "18f8c9d184ba777380794a389fabc179896ba913" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", - "reference": "cbc5b50bfa2688a1afca20e5a8c71f058e9ccbef", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/18f8c9d184ba777380794a389fabc179896ba913", + "reference": "18f8c9d184ba777380794a389fabc179896ba913", "shasum": "" }, "require": { @@ -810,7 +810,7 @@ "type": "github" } ], - "time": "2021-01-18T03:31:06+00:00" + "time": "2021-01-26T00:22:21+00:00" }, { "name": "nikic/php-parser", @@ -1011,16 +1011,16 @@ }, { "name": "prestashop/php-dev-tools", - "version": "v3.14", + "version": "v3.15", "source": { "type": "git", "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "ef4217ee7212e6b65d983371b3255ca38395de44" + "reference": "1570fd43b0f5a8cfa105e6f2211c818c902951f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/ef4217ee7212e6b65d983371b3255ca38395de44", - "reference": "ef4217ee7212e6b65d983371b3255ca38395de44", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/1570fd43b0f5a8cfa105e6f2211c818c902951f0", + "reference": "1570fd43b0f5a8cfa105e6f2211c818c902951f0", "shasum": "" }, "require": { @@ -1031,6 +1031,9 @@ "symfony/console": "~3.2 || ~4.0 || ~5.0", "symfony/filesystem": "~3.2 || ~4.0 || ~5.0" }, + "conflict": { + "friendsofphp/php-cs-fixer": "2.18.3" + }, "bin": [ "bin/prestashop-coding-standards" ], @@ -1045,7 +1048,7 @@ "MIT" ], "description": "PrestaShop coding standards", - "time": "2021-01-18T15:07:05+00:00" + "time": "2021-03-11T15:36:18+00:00" }, { "name": "psr/log", From 36a559a45a0313ff4a7b9c8bf2703e138325b85f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 May 2021 04:05:13 +0000 Subject: [PATCH 10/17] Bump prestashop/php-dev-tools from 3.15 to 3.15.1 Bumps [prestashop/php-dev-tools](https://github.com/PrestaShop/php-dev-tools) from 3.15 to 3.15.1. - [Release notes](https://github.com/PrestaShop/php-dev-tools/releases) - [Commits](https://github.com/PrestaShop/php-dev-tools/compare/v3.15...v3.15.1) Signed-off-by: dependabot[bot] --- composer.lock | 73 ++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/composer.lock b/composer.lock index 15180460..42a400ac 100644 --- a/composer.lock +++ b/composer.lock @@ -529,16 +529,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.5", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "f28d44c286812c714741478d968104c5e604a1d4" + "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/f28d44c286812c714741478d968104c5e604a1d4", - "reference": "f28d44c286812c714741478d968104c5e604a1d4", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", + "reference": "964adcdd3a28bf9ed5d9ac6450064e0d71ed7496", "shasum": "" }, "require": { @@ -546,7 +546,8 @@ "psr/log": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + "phpstan/phpstan": "^0.12.55", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "autoload": { @@ -583,7 +584,7 @@ "type": "tidelift" } ], - "time": "2020-11-13T08:04:11+00:00" + "time": "2021-05-05T19:37:51+00:00" }, { "name": "doctrine/annotations", @@ -715,21 +716,21 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.18.2", + "version": "v2.19.0", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "18f8c9d184ba777380794a389fabc179896ba913" + "reference": "d5b8a9d852b292c2f8a035200fa6844b1f82300b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/18f8c9d184ba777380794a389fabc179896ba913", - "reference": "18f8c9d184ba777380794a389fabc179896ba913", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/d5b8a9d852b292c2f8a035200fa6844b1f82300b", + "reference": "d5b8a9d852b292c2f8a035200fa6844b1f82300b", "shasum": "" }, "require": { "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.2", + "composer/xdebug-handler": "^1.2 || ^2.0", "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", @@ -772,6 +773,11 @@ "php-cs-fixer" ], "type": "application", + "extra": { + "branch-alias": { + "dev-master": "2.19-dev" + } + }, "autoload": { "psr-4": { "PhpCsFixer\\": "src/" @@ -786,6 +792,7 @@ "tests/Test/IntegrationCaseFactoryInterface.php", "tests/Test/InternalIntegrationCaseFactory.php", "tests/Test/IsIdenticalConstraint.php", + "tests/Test/TokensWithObservedTransformers.php", "tests/TestCase.php" ] }, @@ -810,7 +817,7 @@ "type": "github" } ], - "time": "2021-01-26T00:22:21+00:00" + "time": "2021-05-03T21:43:24+00:00" }, { "name": "nikic/php-parser", @@ -865,16 +872,16 @@ }, { "name": "paragonie/random_compat", - "version": "v2.0.19", + "version": "v2.0.20", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241" + "reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/446fc9faa5c2a9ddf65eb7121c0af7e857295241", - "reference": "446fc9faa5c2a9ddf65eb7121c0af7e857295241", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/0f1f60250fccffeaf5dda91eea1c018aed1adc2a", + "reference": "0f1f60250fccffeaf5dda91eea1c018aed1adc2a", "shasum": "" }, "require": { @@ -910,7 +917,7 @@ "pseudorandom", "random" ], - "time": "2020-10-15T10:06:57+00:00" + "time": "2021-04-17T09:33:01+00:00" }, { "name": "php-cs-fixer/diff", @@ -1011,16 +1018,16 @@ }, { "name": "prestashop/php-dev-tools", - "version": "v3.15", + "version": "v3.15.1", "source": { "type": "git", "url": "https://github.com/PrestaShop/php-dev-tools.git", - "reference": "1570fd43b0f5a8cfa105e6f2211c818c902951f0" + "reference": "ed7af694ddd0c7d0f712c3e7c07757c80d042755" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/1570fd43b0f5a8cfa105e6f2211c818c902951f0", - "reference": "1570fd43b0f5a8cfa105e6f2211c818c902951f0", + "url": "https://api.github.com/repos/PrestaShop/php-dev-tools/zipball/ed7af694ddd0c7d0f712c3e7c07757c80d042755", + "reference": "ed7af694ddd0c7d0f712c3e7c07757c80d042755", "shasum": "" }, "require": { @@ -1048,20 +1055,20 @@ "MIT" ], "description": "PrestaShop coding standards", - "time": "2021-03-11T15:36:18+00:00" + "time": "2021-05-12T08:40:17+00:00" }, { "name": "psr/log", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", - "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", "shasum": "" }, "require": { @@ -1085,7 +1092,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for logging libraries", @@ -1095,20 +1102,20 @@ "psr", "psr-3" ], - "time": "2020-03-23T09:12:05+00:00" + "time": "2021-05-03T11:20:27+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.8", + "version": "3.6.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4" + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4", - "reference": "9d583721a7157ee997f235f327de038e7ea6dac4", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", "shasum": "" }, "require": { @@ -1146,7 +1153,7 @@ "phpcs", "standards" ], - "time": "2020-10-23T02:01:07+00:00" + "time": "2021-04-09T00:54:41+00:00" }, { "name": "symfony/console", From 88c75035375720a7356acdc5266661806c3c9b4e Mon Sep 17 00:00:00 2001 From: SD1982 Date: Mon, 17 May 2021 16:27:37 +0200 Subject: [PATCH 11/17] fix duplicated id for review tables --- productcomments.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/productcomments.php b/productcomments.php index 1d33e8fc..4e74337d 100644 --- a/productcomments.php +++ b/productcomments.php @@ -434,7 +434,7 @@ public function renderModerateLists() $helper->listTotal = count($comments); $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Reviews waiting for approval', [], 'Modules.Productcomments.Admin'); - $helper->table = $this->name; + $helper->table = 'productcomments-moderate-list'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -458,7 +458,7 @@ public function renderModerateLists() $helper->listTotal = count($comments); $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Reported Reviews', [], 'Modules.Productcomments.Admin'); - $helper->table = $this->name; + $helper->table = 'productcomments-reported-list'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -566,7 +566,7 @@ public function renderCommentsList() $helper->module = $this; $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Approved Reviews', [], 'Modules.Productcomments.Admin'); - $helper->table = $this->name; + $helper->table = 'productcomments-list'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; From 29e657d9a5c384aa9346ac9d6d81f69e0d80496e Mon Sep 17 00:00:00 2001 From: SD1982 Date: Mon, 24 May 2021 11:28:17 +0200 Subject: [PATCH 12/17] fix product comments not deleted --- productcomments.php | 183 ++++++++++++++++++++++---------------------- 1 file changed, 93 insertions(+), 90 deletions(-) diff --git a/productcomments.php b/productcomments.php index 4e74337d..e5ff4f78 100644 --- a/productcomments.php +++ b/productcomments.php @@ -297,17 +297,17 @@ public function renderConfigForm() 'label' => $this->trans('All reviews must be validated by an employee', [], 'Modules.Productcomments.Admin'), 'name' => 'PRODUCT_COMMENTS_MODERATE', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], [ 'type' => 'switch', @@ -315,17 +315,17 @@ public function renderConfigForm() 'label' => $this->trans('Allow guest reviews', [], 'Modules.Productcomments.Admin'), 'name' => 'PRODUCT_COMMENTS_ALLOW_GUESTS', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], [ 'type' => 'switch', @@ -379,10 +379,10 @@ public function renderConfigForm() 'suffix' => 'comments', ], ], - 'submit' => [ - 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), - 'class' => 'btn btn-default pull-right', - 'name' => 'submitModerate', + 'submit' => [ + 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), + 'class' => 'btn btn-default pull-right', + 'name' => 'submitModerate', ], ], ]; @@ -427,6 +427,7 @@ public function renderModerateLists() $helper = new HelperList(); $helper->list_id = 'form-productcomments-moderate-list'; $helper->shopLinkType = ''; + $helper->table_id = 'waiting-approval-productcomments-list'; $helper->simple_header = true; $helper->actions = $actions; $helper->show_toolbar = false; @@ -434,7 +435,7 @@ public function renderModerateLists() $helper->listTotal = count($comments); $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Reviews waiting for approval', [], 'Modules.Productcomments.Admin'); - $helper->table = 'productcomments-moderate-list'; + $helper->table = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -451,6 +452,7 @@ public function renderModerateLists() $helper = new HelperList(); $helper->list_id = 'form-productcomments-reported-list'; $helper->shopLinkType = ''; + $helper->table_id = 'reported-productcomments-list'; $helper->simple_header = true; $helper->actions = $actions; $helper->show_toolbar = false; @@ -458,7 +460,7 @@ public function renderModerateLists() $helper->listTotal = count($comments); $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Reported Reviews', [], 'Modules.Productcomments.Admin'); - $helper->table = 'productcomments-reported-list'; + $helper->table = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -560,13 +562,14 @@ public function renderCommentsList() $helper = new HelperList(); $helper->list_id = 'form-productcomments-list'; $helper->shopLinkType = ''; + $helper->table_id = 'approved-productcomments-list'; $helper->simple_header = false; $helper->actions = ['delete']; $helper->show_toolbar = false; $helper->module = $this; $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Approved Reviews', [], 'Modules.Productcomments.Admin'); - $helper->table = 'productcomments-list'; + $helper->table = $this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -623,11 +626,11 @@ public function getCriterionFieldsValues($id = 0) $criterion = new ProductCommentCriterion($id); return [ - 'name' => $criterion->name, - 'id_product_comment_criterion_type' => $criterion->id_product_comment_criterion_type, - 'active' => $criterion->active, - 'id_product_comment_criterion' => $criterion->id, - ]; + 'name' => $criterion->name, + 'id_product_comment_criterion_type' => $criterion->id_product_comment_criterion_type, + 'active' => $criterion->active, + 'id_product_comment_criterion' => $criterion->id, + ]; } public function getStandardFieldList() @@ -678,9 +681,9 @@ public function renderCriterionForm($id_criterion = 0) $query = []; foreach ($types as $key => $value) { $query[] = [ - 'id' => $key, - 'label' => $value, - ]; + 'id' => $key, + 'label' => $value, + ]; } $criterion = new ProductCommentCriterion((int) $id_criterion); @@ -696,42 +699,42 @@ public function renderCriterionForm($id_criterion = 0) if (version_compare(_PS_VERSION_, '1.6', '<')) { $field_category_tree = [ - 'type' => 'categories_select', - 'name' => 'categoryBox', - 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), - 'category_tree' => $this->initCategoriesAssociation(null, $id_criterion), - ]; + 'type' => 'categories_select', + 'name' => 'categoryBox', + 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), + 'category_tree' => $this->initCategoriesAssociation(null, $id_criterion), + ]; } else { $field_category_tree = [ - 'type' => 'categories', - 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), - 'name' => 'categoryBox', - 'desc' => $this->trans('Mark the boxes of categories to which this criterion applies.', [], 'Modules.Productcomments.Admin'), - 'tree' => [ - 'use_search' => false, - 'id' => 'categoryBox', - 'use_checkbox' => true, - 'selected_categories' => $selected_categories, - ], - //retro compat 1.5 for category tree - 'values' => [ - 'trads' => [ - 'Root' => Category::getTopCategory(), - 'selected' => $this->trans('Selected', [], 'Modules.Productcomments.Admin'), - 'Collapse All' => $this->trans('Collapse All', [], 'Modules.Productcomments.Admin'), - 'Expand All' => $this->trans('Expand All', [], 'Modules.Productcomments.Admin'), - 'Check All' => $this->trans('Check All', [], 'Modules.Productcomments.Admin'), - 'Uncheck All' => $this->trans('Uncheck All', [], 'Modules.Productcomments.Admin'), - ], - 'selected_cat' => $selected_categories, - 'input_name' => 'categoryBox[]', - 'use_radio' => false, - 'use_search' => false, - 'disabled_categories' => [], - 'top_category' => Category::getTopCategory(), - 'use_context' => true, - ], - ]; + 'type' => 'categories', + 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), + 'name' => 'categoryBox', + 'desc' => $this->trans('Mark the boxes of categories to which this criterion applies.', [], 'Modules.Productcomments.Admin'), + 'tree' => [ + 'use_search' => false, + 'id' => 'categoryBox', + 'use_checkbox' => true, + 'selected_categories' => $selected_categories, + ], + //retro compat 1.5 for category tree + 'values' => [ + 'trads' => [ + 'Root' => Category::getTopCategory(), + 'selected' => $this->trans('Selected', [], 'Modules.Productcomments.Admin'), + 'Collapse All' => $this->trans('Collapse All', [], 'Modules.Productcomments.Admin'), + 'Expand All' => $this->trans('Expand All', [], 'Modules.Productcomments.Admin'), + 'Check All' => $this->trans('Check All', [], 'Modules.Productcomments.Admin'), + 'Uncheck All' => $this->trans('Uncheck All', [], 'Modules.Productcomments.Admin'), + ], + 'selected_cat' => $selected_categories, + 'input_name' => 'categoryBox[]', + 'use_radio' => false, + 'use_search' => false, + 'disabled_categories' => [], + 'top_category' => Category::getTopCategory(), + 'use_context' => true, + ], + ]; } $fields_form_1 = [ @@ -757,10 +760,10 @@ public function renderCriterionForm($id_criterion = 0) 'name' => 'id_product_comment_criterion_type', 'label' => $this->trans('Application scope of the criterion', [], 'Modules.Productcomments.Admin'), 'options' => [ - 'query' => $query, - 'id' => 'id', - 'name' => 'label', - ], + 'query' => $query, + 'id' => 'id', + 'name' => 'label', + ], ], $field_category_tree, [ @@ -775,23 +778,23 @@ public function renderCriterionForm($id_criterion = 0) 'label' => $this->trans('Active', [], 'Modules.Productcomments.Admin'), 'name' => 'active', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], ], - 'submit' => [ - 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), - 'class' => 'btn btn-default pull-right', - 'name' => 'submitEditCriterion', + 'submit' => [ + 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), + 'class' => 'btn btn-default pull-right', + 'name' => 'submitEditCriterion', ], ], ]; From 0ee4dd5440163f97343a78de8b0028e3969051fa Mon Sep 17 00:00:00 2001 From: SD1982 Date: Mon, 24 May 2021 11:34:21 +0200 Subject: [PATCH 13/17] fix comment not deleted V2 --- productcomments.php | 180 ++++++++++++++++++++++---------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/productcomments.php b/productcomments.php index e5ff4f78..f4dac6a7 100644 --- a/productcomments.php +++ b/productcomments.php @@ -297,17 +297,17 @@ public function renderConfigForm() 'label' => $this->trans('All reviews must be validated by an employee', [], 'Modules.Productcomments.Admin'), 'name' => 'PRODUCT_COMMENTS_MODERATE', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], [ 'type' => 'switch', @@ -315,17 +315,17 @@ public function renderConfigForm() 'label' => $this->trans('Allow guest reviews', [], 'Modules.Productcomments.Admin'), 'name' => 'PRODUCT_COMMENTS_ALLOW_GUESTS', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], [ 'type' => 'switch', @@ -379,10 +379,10 @@ public function renderConfigForm() 'suffix' => 'comments', ], ], - 'submit' => [ - 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), - 'class' => 'btn btn-default pull-right', - 'name' => 'submitModerate', + 'submit' => [ + 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), + 'class' => 'btn btn-default pull-right', + 'name' => 'submitModerate', ], ], ]; @@ -427,7 +427,6 @@ public function renderModerateLists() $helper = new HelperList(); $helper->list_id = 'form-productcomments-moderate-list'; $helper->shopLinkType = ''; - $helper->table_id = 'waiting-approval-productcomments-list'; $helper->simple_header = true; $helper->actions = $actions; $helper->show_toolbar = false; @@ -436,6 +435,7 @@ public function renderModerateLists() $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Reviews waiting for approval', [], 'Modules.Productcomments.Admin'); $helper->table = $this->name; + $helper->table_id = 'waiting-approval-productcomments-list'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -452,7 +452,6 @@ public function renderModerateLists() $helper = new HelperList(); $helper->list_id = 'form-productcomments-reported-list'; $helper->shopLinkType = ''; - $helper->table_id = 'reported-productcomments-list'; $helper->simple_header = true; $helper->actions = $actions; $helper->show_toolbar = false; @@ -461,6 +460,7 @@ public function renderModerateLists() $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Reported Reviews', [], 'Modules.Productcomments.Admin'); $helper->table = $this->name; + $helper->table_id = 'reported-productcomments-list'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -562,7 +562,6 @@ public function renderCommentsList() $helper = new HelperList(); $helper->list_id = 'form-productcomments-list'; $helper->shopLinkType = ''; - $helper->table_id = 'approved-productcomments-list'; $helper->simple_header = false; $helper->actions = ['delete']; $helper->show_toolbar = false; @@ -570,6 +569,7 @@ public function renderCommentsList() $helper->identifier = 'id_product_comment'; $helper->title = $this->trans('Approved Reviews', [], 'Modules.Productcomments.Admin'); $helper->table = $this->name; + $helper->table_id = 'approved-productcomments-list'; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->name; $helper->no_link = true; @@ -626,11 +626,11 @@ public function getCriterionFieldsValues($id = 0) $criterion = new ProductCommentCriterion($id); return [ - 'name' => $criterion->name, - 'id_product_comment_criterion_type' => $criterion->id_product_comment_criterion_type, - 'active' => $criterion->active, - 'id_product_comment_criterion' => $criterion->id, - ]; + 'name' => $criterion->name, + 'id_product_comment_criterion_type' => $criterion->id_product_comment_criterion_type, + 'active' => $criterion->active, + 'id_product_comment_criterion' => $criterion->id, + ]; } public function getStandardFieldList() @@ -681,9 +681,9 @@ public function renderCriterionForm($id_criterion = 0) $query = []; foreach ($types as $key => $value) { $query[] = [ - 'id' => $key, - 'label' => $value, - ]; + 'id' => $key, + 'label' => $value, + ]; } $criterion = new ProductCommentCriterion((int) $id_criterion); @@ -699,42 +699,42 @@ public function renderCriterionForm($id_criterion = 0) if (version_compare(_PS_VERSION_, '1.6', '<')) { $field_category_tree = [ - 'type' => 'categories_select', - 'name' => 'categoryBox', - 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), - 'category_tree' => $this->initCategoriesAssociation(null, $id_criterion), - ]; + 'type' => 'categories_select', + 'name' => 'categoryBox', + 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), + 'category_tree' => $this->initCategoriesAssociation(null, $id_criterion), + ]; } else { $field_category_tree = [ - 'type' => 'categories', - 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), - 'name' => 'categoryBox', - 'desc' => $this->trans('Mark the boxes of categories to which this criterion applies.', [], 'Modules.Productcomments.Admin'), - 'tree' => [ - 'use_search' => false, - 'id' => 'categoryBox', - 'use_checkbox' => true, - 'selected_categories' => $selected_categories, - ], - //retro compat 1.5 for category tree - 'values' => [ - 'trads' => [ - 'Root' => Category::getTopCategory(), - 'selected' => $this->trans('Selected', [], 'Modules.Productcomments.Admin'), - 'Collapse All' => $this->trans('Collapse All', [], 'Modules.Productcomments.Admin'), - 'Expand All' => $this->trans('Expand All', [], 'Modules.Productcomments.Admin'), - 'Check All' => $this->trans('Check All', [], 'Modules.Productcomments.Admin'), - 'Uncheck All' => $this->trans('Uncheck All', [], 'Modules.Productcomments.Admin'), - ], - 'selected_cat' => $selected_categories, - 'input_name' => 'categoryBox[]', - 'use_radio' => false, - 'use_search' => false, - 'disabled_categories' => [], - 'top_category' => Category::getTopCategory(), - 'use_context' => true, - ], - ]; + 'type' => 'categories', + 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), + 'name' => 'categoryBox', + 'desc' => $this->trans('Mark the boxes of categories to which this criterion applies.', [], 'Modules.Productcomments.Admin'), + 'tree' => [ + 'use_search' => false, + 'id' => 'categoryBox', + 'use_checkbox' => true, + 'selected_categories' => $selected_categories, + ], + //retro compat 1.5 for category tree + 'values' => [ + 'trads' => [ + 'Root' => Category::getTopCategory(), + 'selected' => $this->trans('Selected', [], 'Modules.Productcomments.Admin'), + 'Collapse All' => $this->trans('Collapse All', [], 'Modules.Productcomments.Admin'), + 'Expand All' => $this->trans('Expand All', [], 'Modules.Productcomments.Admin'), + 'Check All' => $this->trans('Check All', [], 'Modules.Productcomments.Admin'), + 'Uncheck All' => $this->trans('Uncheck All', [], 'Modules.Productcomments.Admin'), + ], + 'selected_cat' => $selected_categories, + 'input_name' => 'categoryBox[]', + 'use_radio' => false, + 'use_search' => false, + 'disabled_categories' => [], + 'top_category' => Category::getTopCategory(), + 'use_context' => true, + ], + ]; } $fields_form_1 = [ @@ -760,10 +760,10 @@ public function renderCriterionForm($id_criterion = 0) 'name' => 'id_product_comment_criterion_type', 'label' => $this->trans('Application scope of the criterion', [], 'Modules.Productcomments.Admin'), 'options' => [ - 'query' => $query, - 'id' => 'id', - 'name' => 'label', - ], + 'query' => $query, + 'id' => 'id', + 'name' => 'label', + ], ], $field_category_tree, [ @@ -778,23 +778,23 @@ public function renderCriterionForm($id_criterion = 0) 'label' => $this->trans('Active', [], 'Modules.Productcomments.Admin'), 'name' => 'active', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], ], - 'submit' => [ - 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), - 'class' => 'btn btn-default pull-right', - 'name' => 'submitEditCriterion', + 'submit' => [ + 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), + 'class' => 'btn btn-default pull-right', + 'name' => 'submitEditCriterion', ], ], ]; From 1d0f6cfd316893321c1d71ab6ca37172731a80ee Mon Sep 17 00:00:00 2001 From: SD1982 Date: Mon, 31 May 2021 14:23:53 +0200 Subject: [PATCH 14/17] Add some classes to the table columns --- productcomments.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/productcomments.php b/productcomments.php index f4dac6a7..4af00eb8 100644 --- a/productcomments.php +++ b/productcomments.php @@ -640,37 +640,44 @@ public function getStandardFieldList() 'title' => $this->trans('ID', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, + 'class' => 'product-comment-id' ], 'title' => [ 'title' => $this->trans('Review title', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, + 'class' => 'product-comment-title' ], 'content' => [ 'title' => $this->trans('Review', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, + 'class' => 'product-comment-content' ], 'grade' => [ 'title' => $this->trans('Rating', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'suffix' => '/5', 'search' => false, + 'class' => 'product-comment-rating' ], 'customer_name' => [ 'title' => $this->trans('Author', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, + 'class' => 'product-comment-author' ], 'name' => [ 'title' => $this->trans('Product', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, + 'class' => 'product-comment-product-name' ], 'date_add' => [ 'title' => $this->trans('Time of publication', [], 'Modules.Productcomments.Admin'), 'type' => 'date', 'search' => false, + 'class' => 'product-comment-date' ], ]; } From a08e877ffc30e8702249c01e5a4b01c4f8a18e35 Mon Sep 17 00:00:00 2001 From: SD1982 Date: Tue, 1 Jun 2021 10:42:42 +0200 Subject: [PATCH 15/17] fix php-cs-fixer fail --- productcomments.php | 201 +++++++++++++++++++++++--------------------- 1 file changed, 103 insertions(+), 98 deletions(-) diff --git a/productcomments.php b/productcomments.php index 4af00eb8..6e7962ae 100644 --- a/productcomments.php +++ b/productcomments.php @@ -1,4 +1,5 @@ registerHook('displayFooterProduct') || //Product page footer !$this->registerHook('header') || //Adds css and javascript on front !$this->registerHook('displayProductListReviews') || //Product list miniature @@ -95,7 +97,8 @@ public function install($keep = true) !Configuration::updateValue('PRODUCT_COMMENTS_USEFULNESS', 1) || !Configuration::updateValue('PRODUCT_COMMENTS_COMMENTS_PER_PAGE', 5) || !Configuration::updateValue('PRODUCT_COMMENTS_ANONYMISATION', 0) || - !Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1)) { + !Configuration::updateValue('PRODUCT_COMMENTS_MODERATE', 1) + ) { return false; } @@ -104,7 +107,8 @@ public function install($keep = true) public function uninstall($keep = true) { - if (!parent::uninstall() || ($keep && !$this->deleteTables()) || + if ( + !parent::uninstall() || ($keep && !$this->deleteTables()) || !Configuration::deleteByName('PRODUCT_COMMENTS_MODERATE') || !Configuration::deleteByName('PRODUCT_COMMENTS_COMMENTS_PER_PAGE') || !Configuration::deleteByName('PRODUCT_COMMENTS_ANONYMISATION') || @@ -119,7 +123,8 @@ public function uninstall($keep = true) !$this->unregisterHook('displayProductAdditionalInfo') || !$this->unregisterHook('header') || !$this->unregisterHook('displayFooterProduct') || - !$this->unregisterHook('displayProductListReviews')) { + !$this->unregisterHook('displayProductListReviews') + ) { return false; } @@ -297,17 +302,17 @@ public function renderConfigForm() 'label' => $this->trans('All reviews must be validated by an employee', [], 'Modules.Productcomments.Admin'), 'name' => 'PRODUCT_COMMENTS_MODERATE', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], [ 'type' => 'switch', @@ -315,17 +320,17 @@ public function renderConfigForm() 'label' => $this->trans('Allow guest reviews', [], 'Modules.Productcomments.Admin'), 'name' => 'PRODUCT_COMMENTS_ALLOW_GUESTS', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], [ 'type' => 'switch', @@ -379,10 +384,10 @@ public function renderConfigForm() 'suffix' => 'comments', ], ], - 'submit' => [ - 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), - 'class' => 'btn btn-default pull-right', - 'name' => 'submitModerate', + 'submit' => [ + 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), + 'class' => 'btn btn-default pull-right', + 'name' => 'submitModerate', ], ], ]; @@ -626,11 +631,11 @@ public function getCriterionFieldsValues($id = 0) $criterion = new ProductCommentCriterion($id); return [ - 'name' => $criterion->name, - 'id_product_comment_criterion_type' => $criterion->id_product_comment_criterion_type, - 'active' => $criterion->active, - 'id_product_comment_criterion' => $criterion->id, - ]; + 'name' => $criterion->name, + 'id_product_comment_criterion_type' => $criterion->id_product_comment_criterion_type, + 'active' => $criterion->active, + 'id_product_comment_criterion' => $criterion->id, + ]; } public function getStandardFieldList() @@ -640,44 +645,44 @@ public function getStandardFieldList() 'title' => $this->trans('ID', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, - 'class' => 'product-comment-id' + 'class' => 'product-comment-id', ], 'title' => [ 'title' => $this->trans('Review title', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, - 'class' => 'product-comment-title' + 'class' => 'product-comment-title', ], 'content' => [ 'title' => $this->trans('Review', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, - 'class' => 'product-comment-content' + 'class' => 'product-comment-content', ], 'grade' => [ 'title' => $this->trans('Rating', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'suffix' => '/5', 'search' => false, - 'class' => 'product-comment-rating' + 'class' => 'product-comment-rating', ], 'customer_name' => [ 'title' => $this->trans('Author', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, - 'class' => 'product-comment-author' + 'class' => 'product-comment-author', ], 'name' => [ 'title' => $this->trans('Product', [], 'Modules.Productcomments.Admin'), 'type' => 'text', 'search' => false, - 'class' => 'product-comment-product-name' + 'class' => 'product-comment-product-name', ], 'date_add' => [ 'title' => $this->trans('Time of publication', [], 'Modules.Productcomments.Admin'), 'type' => 'date', 'search' => false, - 'class' => 'product-comment-date' + 'class' => 'product-comment-date', ], ]; } @@ -688,9 +693,9 @@ public function renderCriterionForm($id_criterion = 0) $query = []; foreach ($types as $key => $value) { $query[] = [ - 'id' => $key, - 'label' => $value, - ]; + 'id' => $key, + 'label' => $value, + ]; } $criterion = new ProductCommentCriterion((int) $id_criterion); @@ -706,42 +711,42 @@ public function renderCriterionForm($id_criterion = 0) if (version_compare(_PS_VERSION_, '1.6', '<')) { $field_category_tree = [ - 'type' => 'categories_select', - 'name' => 'categoryBox', - 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), - 'category_tree' => $this->initCategoriesAssociation(null, $id_criterion), - ]; + 'type' => 'categories_select', + 'name' => 'categoryBox', + 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), + 'category_tree' => $this->initCategoriesAssociation(null, $id_criterion), + ]; } else { $field_category_tree = [ - 'type' => 'categories', - 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), - 'name' => 'categoryBox', - 'desc' => $this->trans('Mark the boxes of categories to which this criterion applies.', [], 'Modules.Productcomments.Admin'), - 'tree' => [ - 'use_search' => false, - 'id' => 'categoryBox', - 'use_checkbox' => true, - 'selected_categories' => $selected_categories, - ], - //retro compat 1.5 for category tree - 'values' => [ - 'trads' => [ - 'Root' => Category::getTopCategory(), - 'selected' => $this->trans('Selected', [], 'Modules.Productcomments.Admin'), - 'Collapse All' => $this->trans('Collapse All', [], 'Modules.Productcomments.Admin'), - 'Expand All' => $this->trans('Expand All', [], 'Modules.Productcomments.Admin'), - 'Check All' => $this->trans('Check All', [], 'Modules.Productcomments.Admin'), - 'Uncheck All' => $this->trans('Uncheck All', [], 'Modules.Productcomments.Admin'), - ], - 'selected_cat' => $selected_categories, - 'input_name' => 'categoryBox[]', - 'use_radio' => false, - 'use_search' => false, - 'disabled_categories' => [], - 'top_category' => Category::getTopCategory(), - 'use_context' => true, - ], - ]; + 'type' => 'categories', + 'label' => $this->trans('Criterion will be restricted to the following categories', [], 'Modules.Productcomments.Admin'), + 'name' => 'categoryBox', + 'desc' => $this->trans('Mark the boxes of categories to which this criterion applies.', [], 'Modules.Productcomments.Admin'), + 'tree' => [ + 'use_search' => false, + 'id' => 'categoryBox', + 'use_checkbox' => true, + 'selected_categories' => $selected_categories, + ], + //retro compat 1.5 for category tree + 'values' => [ + 'trads' => [ + 'Root' => Category::getTopCategory(), + 'selected' => $this->trans('Selected', [], 'Modules.Productcomments.Admin'), + 'Collapse All' => $this->trans('Collapse All', [], 'Modules.Productcomments.Admin'), + 'Expand All' => $this->trans('Expand All', [], 'Modules.Productcomments.Admin'), + 'Check All' => $this->trans('Check All', [], 'Modules.Productcomments.Admin'), + 'Uncheck All' => $this->trans('Uncheck All', [], 'Modules.Productcomments.Admin'), + ], + 'selected_cat' => $selected_categories, + 'input_name' => 'categoryBox[]', + 'use_radio' => false, + 'use_search' => false, + 'disabled_categories' => [], + 'top_category' => Category::getTopCategory(), + 'use_context' => true, + ], + ]; } $fields_form_1 = [ @@ -767,10 +772,10 @@ public function renderCriterionForm($id_criterion = 0) 'name' => 'id_product_comment_criterion_type', 'label' => $this->trans('Application scope of the criterion', [], 'Modules.Productcomments.Admin'), 'options' => [ - 'query' => $query, - 'id' => 'id', - 'name' => 'label', - ], + 'query' => $query, + 'id' => 'id', + 'name' => 'label', + ], ], $field_category_tree, [ @@ -785,23 +790,23 @@ public function renderCriterionForm($id_criterion = 0) 'label' => $this->trans('Active', [], 'Modules.Productcomments.Admin'), 'name' => 'active', 'values' => [ - [ - 'id' => 'active_on', - 'value' => 1, - 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), - ], - [ - 'id' => 'active_off', - 'value' => 0, - 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), - ], - ], + [ + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->trans('Yes', [], 'Modules.Productcomments.Admin'), + ], + [ + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->trans('No', [], 'Modules.Productcomments.Admin'), + ], + ], ], ], - 'submit' => [ - 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), - 'class' => 'btn btn-default pull-right', - 'name' => 'submitEditCriterion', + 'submit' => [ + 'title' => $this->trans('Save', [], 'Modules.Productcomments.Admin'), + 'class' => 'btn btn-default pull-right', + 'name' => 'submitEditCriterion', ], ], ]; From 3a4990729039077774cd83502c05d31a4e42363c Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 4 Jun 2021 10:11:24 +0200 Subject: [PATCH 16/17] Bump version to 4.2.2 --- config.xml | 2 +- productcomments.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.xml b/config.xml index f4586edb..9f065c3d 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ productcomments - + diff --git a/productcomments.php b/productcomments.php index 6e7962ae..716267bb 100644 --- a/productcomments.php +++ b/productcomments.php @@ -46,7 +46,7 @@ public function __construct() { $this->name = 'productcomments'; $this->tab = 'front_office_features'; - $this->version = '4.2.1'; + $this->version = '4.2.2'; $this->author = 'PrestaShop'; $this->need_instance = 0; $this->bootstrap = true; From 0378d4cc905574fc0055e5e645d5408e110f7449 Mon Sep 17 00:00:00 2001 From: "J.F. Viguier" Date: Fri, 4 Jun 2021 15:46:59 +0200 Subject: [PATCH 17/17] remove useless upgrade file --- upgrade/install-5.0.0.php | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 upgrade/install-5.0.0.php diff --git a/upgrade/install-5.0.0.php b/upgrade/install-5.0.0.php deleted file mode 100644 index dea7c5ee..00000000 --- a/upgrade/install-5.0.0.php +++ /dev/null @@ -1,38 +0,0 @@ - - * @copyright Since 2007 PrestaShop SA and Contributors - * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) - */ -if (!defined('_PS_VERSION_')) { - exit; -} - -function upgrade_module_5_0_0($object) -{ - if (!Configuration::hasKey('PRODUCT_COMMENTS_PAGE_COMMENTS_NB')) { - Configuration::set('PRODUCT_COMMENTS_PAGE_COMMENTS_NB', 8); - } - if (!Configuration::hasKey('PRODUCT_COMMENTS_USEFULNESS')) { - Configuration::set('PRODUCT_COMMENTS_USEFULNESS', 1); - } -}