Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting products by cheapest or most expensive price is broken #10266

Closed
qlerebours opened this issue Mar 26, 2019 · 2 comments
Closed

Sorting products by cheapest or most expensive price is broken #10266

qlerebours opened this issue Mar 26, 2019 · 2 comments
Labels
Critical Issues and PRs, which are critical and should be fixed ASAP. Potential Bug Potential bugs or bugfixes, that needs to be reproduced.

Comments

@qlerebours
Copy link

Sylius version affected: 1.4.0

Description

When sorting products in the shop by cheapest or most expensive price, Sylius catches an SQL error.

image

Steps to reproduce

To reproduce it, you can simply go to the Sylius demo with this link : https://master.demo.sylius.com/en_US/taxons/t-shirts/men and sort items by cheapest price or most expansive price. You got a 500 error.

Possible Solution

SQLSTATE[HY000]: General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column 'sylius_dev.s5_.price' which is not in SELECT list; this is incompatible with DISTINCT
The error says that it should add ORDER BY parameters in the SELECT clause.

@Zales0123 Zales0123 added the Potential Bug Potential bugs or bugfixes, that needs to be reproduced. label Mar 26, 2019
@pamil pamil added the Critical Issues and PRs, which are critical and should be fixed ASAP. label Mar 26, 2019
@vvasiloi
Copy link
Contributor

vvasiloi commented Mar 26, 2019

It is working on 1.4.0, but not on 1.4.1 and master.
I don't see in the diff any potential causes of this issue, so I think it's related to database configuration.
Maybe somethig related to sql_mode.

@vvasiloi
Copy link
Contributor

I was on the right path.
Tested 1.4.0 again after adding ONLY_FULL_GROUP_BY to sql_mode and it thrown the same exception.
I'm running MYSQL 5.7.23 which didn't have that mode added by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical Issues and PRs, which are critical and should be fixed ASAP. Potential Bug Potential bugs or bugfixes, that needs to be reproduced.
Projects
None yet
Development

No branches or pull requests

4 participants