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

Include custom source model options in attribute index - Up port #16727 #19176

Merged
merged 12 commits into from
Dec 6, 2018

Conversation

rain2o
Copy link
Contributor

@rain2o rain2o commented Nov 12, 2018

Description

This is an up-port of #16727 from 2.2 to 2.3

When a multiselect Product Attribute uses a custom source model those values are not included when indexing the attribute values for filters on the product grid. The result is those attributes cannot be used as a filter in the product grid.

This was originally opened as issue #417 but was closed as it was considered a feature request and moved to the forums here. The solution is based on @maderlock's comment here but replaced the use of ObjectManager with dependency injection of AttributeRepositoryInterface.

Fixed Issues

  1. Attribute Indexing ignores custom source model options #417 : Attribute Indexing ignores custom source model options

Manual testing scenarios

  1. Create a multiselect attribute with a custom source model. For a quick test I created this sample module.
  2. Within the attribute set Use in Layered Navigation to "Filterable (with results)" (if using the sample module this is already done.)
  3. Select one or more values for the given attribute on two or more products in the same category.
  4. View the category page. The new attribute should now be an available filter.

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-cicd2
Copy link
Contributor

magento-cicd2 commented Nov 12, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @rain2o. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@rain2o
Copy link
Contributor Author

rain2o commented Nov 13, 2018

The Travis CI build failed, but it looks like it just timed out. I don't see any errors. Is there a way to re-trigger the build?

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Please take a look at the code review comments

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

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

Thanks for collaboration. Please see my review notes, also it would be great to ensure integration tests coverage of this change

@rain2o
Copy link
Contributor Author

rain2o commented Nov 22, 2018

@sivaschenko Regarding the integration tests, do you have any suggestions for a source model? I can't think of any existing source models in the Catalog module that would work for the tests. Or would it be best to create a test source model in the test suite?

@sivaschenko
Copy link
Member

@rain2o if you cannot find appropriate source models for the test in the code base, a test source model would be fine

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Nov 26, 2018
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-3566 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@rain2o thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team
Copy link
Contributor

Hi @rain2o. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants