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

StockItemCriteria::setProductsFilter doesn't work with array of ids #7678

Closed
mcjwsk opened this issue Dec 5, 2016 · 5 comments
Closed

StockItemCriteria::setProductsFilter doesn't work with array of ids #7678

mcjwsk opened this issue Dec 5, 2016 · 5 comments
Assignees
Labels
bug report Event: MMNY17 Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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

Comments

@mcjwsk
Copy link
Contributor

mcjwsk commented Dec 5, 2016

Preconditions

  1. Magento 2.1.2 EE
  2. PHP 7.0.9

Steps to reproduce

/** @var \Magento\CatalogInventory\Api\StockItemCriteriaInterface $criteria */
$criteria = $this->criteriaFactory->create();
$criteria->setProductsFilter([1, 3, 5, 7, 9]);
$collection = $this->stockItemRepository->getList($criteria);
echo $collection->getTotalCount();

Expected result

5

Actual result

1

It works if you change the product filter to:

/** @var \Magento\CatalogInventory\Api\StockItemCriteriaInterface $criteria */
$criteria = $this->criteriaFactory->create();
$criteria->setProductsFilter([[1, 3, 5, 7, 9]]);
$collection = $this->stockItemRepository->getList($criteria);
echo $collection->getTotalCount(); // 5

This issue is a duplicate of the ticket #4328

@AydinHassan
Copy link
Contributor

I have also just experienced this today - can confirm a bug.

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 11, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 Oct 9, 2017
@magento-engcom-team
Copy link
Contributor

@DariuszMaciejewski, thank you for your report.
We've created internal ticket(s) MAGETWO-81245 to track progress on the issue.

@kirmorozov
Copy link
Member

Will take care of it. #SQUASHTOBERFEST

@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82004

@okorshenko
Copy link
Contributor

the issue has been fixed in 2.2-develop branch and will be available in 2.2.2 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Event: MMNY17 Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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

No branches or pull requests

7 participants