From e229211954be9bd5f4ba59191a83194103281167 Mon Sep 17 00:00:00 2001 From: Yohan Giarelli Date: Wed, 23 Jan 2019 22:23:28 +0100 Subject: [PATCH 1/2] Added productTaxon to product list query to prevent an SQL error Ordering by ProductTaxon position could not work due to the distinct statement --- src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php index e184c6719bb..81a3b2c9183 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductRepository.php @@ -72,6 +72,7 @@ public function createShopListQueryBuilder( $queryBuilder = $this->createQueryBuilder('o') ->distinct() ->addSelect('translation') + ->addSelect('productTaxon') ->innerJoin('o.translations', 'translation', 'WITH', 'translation.locale = :locale') ->innerJoin('o.productTaxons', 'productTaxon') ->andWhere('productTaxon.taxon = :taxon') From 261236ed581cadbb13bf8414544398fdbe443b1d Mon Sep 17 00:00:00 2001 From: Mateusz Zalewski Date: Thu, 31 Jan 2019 11:06:32 +0100 Subject: [PATCH 2/2] Quick fix for the scenario --- .../viewing_products_from_taxon_and_children.feature | 4 ---- 1 file changed, 4 deletions(-) diff --git a/features/product/viewing_products/viewing_products_from_taxon_and_children.feature b/features/product/viewing_products/viewing_products_from_taxon_and_children.feature index c8c2358b6b9..dcf917bab95 100644 --- a/features/product/viewing_products/viewing_products_from_taxon_and_children.feature +++ b/features/product/viewing_products/viewing_products_from_taxon_and_children.feature @@ -23,9 +23,6 @@ Feature: Viewing products from taxon children And the store has a product "T-Shirt Watermelon" available in "Poland" channel And this product belongs to "T-Shirts" And this product belongs to "Men" - And the store has a product "T-Shirt Lemon" available in "Poland" channel - And this product belongs to "T-Shirts" - And this product belongs to "Men" @ui Scenario: Viewing products from taxon children @@ -35,4 +32,3 @@ Feature: Viewing products from taxon children And I should see the product "T-Shirt Apple" And I should see the product "T-Shirt Pear" And I should see the product "T-Shirt Watermelon" - And I should see the product "T-Shirt Lemon"