Skip to content

[Port to 2.3-develop] Sort configurable attribute options by sort_order #13011

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

Merged

Conversation

wardcapp
Copy link
Contributor

@wardcapp wardcapp commented Jan 5, 2018

Port of PR #12963 to the 2.3-develop branch.
See github issue #7441, internal ticket MAGETWO-61484 and PR #12420.

Description

Resolves the issue documented in GitHub ticket #7441. A similar PR was opened before (#12963), which is now ported to the 2.3-develop branch.

Fixed Issues

  1. Configurable attribute options are not sorted #7441: Configurable attribute options are not sorted

Manual testing scenarios

(copied over from PR #12420, which is still valid)
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
  • All automated tests passed successfully (was tested with success locally, awaiting results from Travis)

When fetching configurable options using the configurable product
option select builder, the sort_order of each option should be taken
into account as well, making sure the desired sorting is passed to the
frontend.

See github issue magento#7441, internal ticket MAGETWO-61484 and PR#12420 for more on this.
@magento-engcom-team magento-engcom-team added bugfix Component: Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line 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 Jan 5, 2018
@ishakhsuvarov ishakhsuvarov self-assigned this Jan 6, 2018
@ishakhsuvarov ishakhsuvarov added this to the January 2018 milestone Jan 6, 2018
@wardcapp
Copy link
Contributor Author

wardcapp commented Jan 6, 2018

The jasmine test failures (reported by Travis) do not seem to relate to the changes made and I cannot reproduce the failures locally (using the Luma theme, blank was tested as well):

...
Magento_Ui/js/form/components/collection
   "initElement" method
     ✓ Check for defined 
     ✓ Check answer type
     ✓ Check returned value if method called with object arguments
     ✓ Check returned value type if method called object arguments
     ✓ Check call method "this.bubble" inner initElement method
   "initChildren" method
     ✓ Check for defined 
     ✓ Check answer type
     ✓ Check returned value if method called without arguments
     ✓ Check returned value type if method called without arguments
     ✓ Check call method "this.source.get" inner initElement method
     ✓ Check this.initialItems property affter called initChildren
   "addChild" method
     ✓ Check for defined 
     ✓ Check answer type
     ✓ Check returned value if method called with arguments
     ✓ Check returned value type if method called with arguments
     ✓ Check this.childIndex property affter called addChild
   "hasChanged" method
     ✓ Check for defined 
     ✓ Check answer type
     ✓ Check returned value if method called without arguments
     ✓ Check returned value type if method called without arguments
   "validate" method
     ✓ Check for defined 
     ✓ Check answer type
     ✓ Check returned value if method called without arguments
     ✓ Check returned value type if method called without arguments
   "removeAddress" method
     ✓ Check for defined 
     ✓ Check answer type
...
log: Deprecation warning: value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments: 
[0] _isAMomentObject: true, _isUTC: false, _useUTC: false, _l: undefined, _i: 01/5/2018, _f: undefined, _strict: undefined, _locale: [object Object]
undefined
   ✓ writes picked date's value to assigned observable
 i18n binding
   ✓ if inline translation is off, just set text for element
   ✓ if inline translation is on, and there is no translation for this text, set original text for element
 Magento_Ui/js/form/form
   "initAdapter" method
     ✓ Check for defined 
     ✓ Check method type
     ✓ Check returned value if method called without arguments
     ✓ Check returned value type if method called without arguments
   "initialize" method
     ✓ Check for defined 
     ✓ Check method type
     ✓ Check returned value if method called without arguments
     ✓ Check returned value type if method called without arguments
   "initConfig" method
     ✓ Check for defined 
     ✓ Check method type
     ✓ Check returned value if method called without arguments
     ✓ Check returned value type if method called without arguments
     ✓ Check this.selector property (is modify in initConfig method)
   "hideLoader" method
     ✓ Check for defined 
     ✓ Check method type
     ✓ Check returned value if method called without arguments
     ✓ Check returned value type if method called without arguments
   "save" method
     ✓ Check for defined 
     ✓ Check method type
   "submit" method
     ✓ Check for defined 
     ✓ Check method type
   "validate" method
     ✓ Check for defined 
     ✓ Check method type
   "reset" method
     ✓ Check for defined 
     ✓ Check method type
...

885 specs in 106.057s.
>> 0 failures
(node:3082) DeprecationWarning: Calling an asynchronous function without callback is deprecated.

Done.


Execution Time (2018-01-05 22:09:54 UTC-0)
jasmine:luma    1m 50.5s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 99%
Total 1m 51.4s

885 specs in 104.042s.
>> 0 failures
(node:3127) DeprecationWarning: Calling an asynchronous function without callback is deprecated.

Done.

Not quite sure what went wrong when Travis executed those tests. A newer PR, #13012, strangely did pass the same tests.

@magento-team magento-team merged commit 0d7f309 into magento:2.3-develop Jan 9, 2018
magento-team pushed a commit that referenced this pull request Jan 9, 2018
@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Component: Catalog Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Progress: accept Release Line: 2.3 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.

4 participants