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

Fix Configurable attribute options are not sorted #7441 #12420

Closed
wants to merge 1 commit into from
Closed

Fix Configurable attribute options are not sorted #7441 #12420

wants to merge 1 commit into from

Conversation

larsroettig
Copy link
Member

@larsroettig larsroettig commented Nov 23, 2017

Bugfix for #7441 - Configurable attribute options are not sorted

Steps to reproduce
Create a configurable attribute and add two options at least.
Create a configurable product for these options.
Go to the product page and see the configurable attribute select (options).
Change attribute options sort order and flush all caches.
Go to the product page and see the configurable attribute select (options) looks like before.

Expected result:

Configurable options HAVE been reordered.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team magento-engcom-team added bugfix Component: Catalog Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Nov 23, 2017
@orlangur orlangur self-assigned this Nov 24, 2017
@orlangur orlangur added this to the November 2017 milestone Nov 24, 2017
@orlangur
Copy link
Contributor

Hi @larsroettig, there was a feedback #7441 (comment) such solution does not work in 2.2.x but hope you tried it in action :)

@@ -97,6 +101,8 @@ public function getSelect(AbstractAttribute $superAttribute, int $productId, Sco
)->where(
'attribute.attribute_id = ?',
$superAttribute->getAttributeId()
)->order(
'attribute_opt.sort_order ASC'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good to me.

Please update existing unit test: https://travis-ci.org/magento/magento2/jobs/306413370 and add a separate test method to just check options are returned in correct order.

After that please do an amend commit and force push to the same branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I already see maybe I add also a integrations test because only PHPUnit test makes not so much sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, something involving a real database would be more than appreciated here.

@orlangur
Copy link
Contributor

Hi @larsroettig, did you meet any obstacles with this PR?

@orlangur
Copy link
Contributor

Closing due to inactivity. Feel free to reach me out anytime later if you wish to continue work on this pull request and it will be reopened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Component: Catalog Progress: needs update Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants