From 1082ecd45b063ace89990336804d2eb39199eb35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Prz=C4=99dzik?= <46092482+rprzedzik@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:36:23 +0100 Subject: [PATCH] Bugfix(grid) fix product grid query builder after optymise (#1866) --- CHANGELOG.md | 4 +++ composer.json | 1 + composer.lock | 31 +++++++++++++------ .../DateAttributeDataSetQueryBuilder.php | 1 + .../NumericAttributeDataSetQueryBuilder.php | 1 + .../PriceAttributeDataSetQueryBuilder.php | 1 + .../UnitAttributeDataSetQueryBuilder.php | 1 + 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f92c20393..3d49a7469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ ## CHANGELOG FOR 1.1.x +#### 1.1.9 +- bugfix [#1848](https://github.com/ergonode/backend/issues/1848) Long response times for product grid endpoint - change query after postgress query problem (rprzedzik) + #### 1.1.8 - bugfix [#1848](https://github.com/ergonode/backend/issues/1848) Long response times for product grid endpoint (rprzedzik) + #### 1.1.7 - bugfix [#1816](https://github.com/ergonode/backend/issues/1816) Fixed product audits (rprzedzik) diff --git a/composer.json b/composer.json index c7cf9ad9a..d4a83b669 100644 --- a/composer.json +++ b/composer.json @@ -72,6 +72,7 @@ "behatch/contexts": "^3.3", "dama/doctrine-test-bundle": "^6.6", "escapestudios/symfony2-coding-standard": "^3.10", + "fakerphp/faker": "1.17.0", "friends-of-behat/symfony-extension": "^2.0.5", "friendsofphp/proxy-manager-lts": "^1.0", "infection/infection": "^0.17.5", diff --git a/composer.lock b/composer.lock index c7840b160..40bf264ff 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8e2befd3a2e7347353ba17b8e7d170a3", + "content-hash": "d03a46fb69094a9faf8e89dbea3ea671", "packages": [ { "name": "beberlei/assert", @@ -9395,20 +9395,22 @@ }, { "name": "fakerphp/faker", - "version": "v1.13.0", + "version": "v1.17.0", "source": { "type": "git", "url": "https://github.com/FakerPHP/Faker.git", - "reference": "ab3f5364d01f2c2c16113442fb987d26e4004913" + "reference": "b85e9d44eae8c52cca7aa0939483611f7232b669" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/ab3f5364d01f2c2c16113442fb987d26e4004913", - "reference": "ab3f5364d01f2c2c16113442fb987d26e4004913", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/b85e9d44eae8c52cca7aa0939483611f7232b669", + "reference": "b85e9d44eae8c52cca7aa0939483611f7232b669", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "^7.1 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" }, "conflict": { "fzaninotto/faker": "*" @@ -9416,9 +9418,20 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-intl": "*", - "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.4.2" + "symfony/phpunit-bridge": "^4.4 || ^5.2" + }, + "suggest": { + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v1.17-dev" + } + }, "autoload": { "psr-4": { "Faker\\": "src/Faker/" @@ -9441,9 +9454,9 @@ ], "support": { "issues": "https://github.com/FakerPHP/Faker/issues", - "source": "https://github.com/FakerPHP/Faker/tree/v1.13.0" + "source": "https://github.com/FakerPHP/Faker/tree/v1.17.0" }, - "time": "2020-12-18T16:50:48+00:00" + "time": "2021-12-05T17:14:47+00:00" }, { "name": "friends-of-behat/mink-extension", diff --git a/module/product/src/Infrastructure/Grid/Builder/Query/DateAttributeDataSetQueryBuilder.php b/module/product/src/Infrastructure/Grid/Builder/Query/DateAttributeDataSetQueryBuilder.php index 1f4bfaef0..7a3df120b 100644 --- a/module/product/src/Infrastructure/Grid/Builder/Query/DateAttributeDataSetQueryBuilder.php +++ b/module/product/src/Infrastructure/Grid/Builder/Query/DateAttributeDataSetQueryBuilder.php @@ -56,6 +56,7 @@ public function addSelect(QueryBuilder $query, string $key, AbstractAttribute $a JOIN product_value pv ON pv.value_id = vt.value_id WHERE attribute_id = \'%s\' AND language = \'%s\' + AND value ~ \'^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$\' )', $key, $attribute->getId()->getValue(), diff --git a/module/product/src/Infrastructure/Grid/Builder/Query/NumericAttributeDataSetQueryBuilder.php b/module/product/src/Infrastructure/Grid/Builder/Query/NumericAttributeDataSetQueryBuilder.php index b3706fdd8..de0febc7b 100644 --- a/module/product/src/Infrastructure/Grid/Builder/Query/NumericAttributeDataSetQueryBuilder.php +++ b/module/product/src/Infrastructure/Grid/Builder/Query/NumericAttributeDataSetQueryBuilder.php @@ -55,6 +55,7 @@ public function addSelect(QueryBuilder $query, string $key, AbstractAttribute $a JOIN product_value pv ON pv.value_id = vt.value_id WHERE attribute_id = \'%s\' AND language = \'%s\' + AND value ~ \'^\d+(\\.\\d+)?$\' )', $key, $attribute->getId()->getValue(), diff --git a/module/product/src/Infrastructure/Grid/Builder/Query/PriceAttributeDataSetQueryBuilder.php b/module/product/src/Infrastructure/Grid/Builder/Query/PriceAttributeDataSetQueryBuilder.php index 4ff401955..c5f586b04 100644 --- a/module/product/src/Infrastructure/Grid/Builder/Query/PriceAttributeDataSetQueryBuilder.php +++ b/module/product/src/Infrastructure/Grid/Builder/Query/PriceAttributeDataSetQueryBuilder.php @@ -56,6 +56,7 @@ public function addSelect(QueryBuilder $query, string $key, AbstractAttribute $a JOIN product_value pv ON pv.value_id = vt.value_id WHERE attribute_id = \'%s\' AND language = \'%s\' + AND value ~ \'^\d+(\\.\\d+)?$\' )', $key, $attribute->getId()->getValue(), diff --git a/module/product/src/Infrastructure/Grid/Builder/Query/UnitAttributeDataSetQueryBuilder.php b/module/product/src/Infrastructure/Grid/Builder/Query/UnitAttributeDataSetQueryBuilder.php index 838479c77..aeadb9519 100644 --- a/module/product/src/Infrastructure/Grid/Builder/Query/UnitAttributeDataSetQueryBuilder.php +++ b/module/product/src/Infrastructure/Grid/Builder/Query/UnitAttributeDataSetQueryBuilder.php @@ -58,6 +58,7 @@ public function addSelect(QueryBuilder $query, string $key, AbstractAttribute $a JOIN product_value pv ON pv.value_id = vt.value_id WHERE attribute_id = \'%s\' AND language = \'%s\' + AND value ~ \'^\d+(\\.\\d+)?$\' )', $key, $attribute->getId()->getValue(),