Skip to content

FIX #11022 in 2.1-develop: Filter Groups of search criteria parameter have not been included for further processing #11432

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

davidverholen
Copy link
Member

Description

The Filter Groups and the Sort Order of the $searchCriteria parameter have not been included in the searchCriteria Object that is finally provided for the eav set repository.

This Pull request sets the filtergroups and sort order in the searchCriteriaBuilder

Fixed Issues (if relevant)

  1. GET v1/products/attribute-sets/sets/list inconsistent return result #11022: GET v1/products/attribute-sets/sets/list inconsistent return result

Manual testing scenarios

  1. Create an additional product attribute set
  2. call to GET http://URL/rest/v1/products/attribute-sets/sets/list?searchCriteria[filter_groups][0][filters][0][field]=attribute_set_name&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][0][filters][0][value]=default
  3. Result should be only the default attribute set (before it always returned all product attribute sets)

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)

//cc @dmanners

@dmanners dmanners self-assigned this Oct 13, 2017
@dmanners dmanners added this to the October 2017 milestone Oct 23, 2017
@dmanners dmanners added Release Line: 2.1 2.2.x 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 Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog labels Oct 23, 2017
Copy link
Contributor

@dmanners dmanners left a comment

Choose a reason for hiding this comment

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

This does not actually seem to fix this problem in 2.1

@dmanners
Copy link
Contributor

@davidverholen after testing this with 2.1 it does not actually seem to fix the issue. When you call the described API endpoints you still get all the data back. Unlike the 2.2 fix which showed only those that match the search.

@okorshenko okorshenko modified the milestones: October 2017, November 2017 Nov 1, 2017
@davidverholen davidverholen force-pushed the squashtoberfest-11022-2.1 branch from 751ea43 to 525f90a Compare November 3, 2017 08:21
@davidverholen
Copy link
Member Author

@dmanners the problem is, that the filters of the search criteria are ignored in the eav attribute repository getList function in 2.1.

I've added a workaround which should fix this until it's replaced by the CollectionProcessor in 2.2

@@ -212,7 +212,7 @@ public function testGetList()
$searchCriteriaMock = $this->getMock('\Magento\Framework\Api\SearchCriteriaInterface');

$filterGroupMock = $this->getMock('\Magento\Framework\Api\Search\FilterGroup', [], [], '', false);
$searchCriteriaMock->expects($this->once())->method('getFilterGroups')->willReturn([$filterGroupMock]);
$searchCriteriaMock->expects($this->exactly(2))->method('getFilterGroups')->willReturn([$filterGroupMock]);

$filterMock = $this->getMock('\Magento\Framework\Api\Filter', [], [], '', false);
$filterGroupMock->expects($this->once())->method('getFilters')->willReturn([$filterMock]);
Copy link
Contributor

Choose a reason for hiding this comment

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

@davidverholen I think this is the method that needs to be called more than once in the tests.

@dmanners dmanners added the Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release label Nov 4, 2017
@okorshenko okorshenko merged commit e9339ca into magento:2.1-develop Nov 9, 2017
okorshenko pushed a commit that referenced this pull request Nov 9, 2017
…teria parameter have not been included for further processing #11432
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Progress: accept Release Line: 2.1 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