-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
#24357 Eav sort order by attribute option_id #24360
Conversation
Hi @tnsezer. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
Hi @tnsezer thanks for your contribution! You say:
I may be wrong but shouldn't it be ordered by My interpretation is that the It's just my interpretation, maybe @sidolov or @magento-engcom-team can shed some light on this. |
Hi @aleron75 There are many type of data that why it would be hard to order by value and be wrong because Magento offers ordering the attributes that why it won’t make sense if we order by value |
…24357 # Conflicts: # app/code/Magento/Eav/Model/Entity/Attribute/Source/Table.php # app/code/Magento/Eav/Test/Unit/Model/Entity/Attribute/Source/TableTest.php
I merged the new version to this branch |
Hi @aleron75, thank you for the review.
|
Hi @tnsezer, thank you for your contribution! |
Referring issue: #24357
Preconditions (*)
2.Php 7.2
Steps to reproduce (*)
https://ibb.co/fQCNbVy
But the query orders it by option_id of eav_attribute_option_value table. but it must be ordered by sort_order of eav_attribute_option table. but it doesn't add into the join.
the query is produced by \Magento\Eav\Model\Entity\Attribute\Source\Table::addValueSortToCollection method.
Expected result (*)
It must be ordered by sort_order of eav_attribute_option table
Actual result (*)
It is ordered by option_id of eav_attribute_option_value table to check the query output below
You can see the query orders like
ORDER BY a5637144578 ASC
But the data comes from option_id
IF(a5637144578_option_value_t2.value_id IS NULL, a5637144578_option_value_t1.option_id, a5637144578_option_value_t2.option_id) AS a5637144578