Skip to content

Conversation

@rostyslav-hymon
Copy link
Contributor

@rostyslav-hymon rostyslav-hymon commented Mar 27, 2018

Original Pull Request

#13716 + #14385
The problem is that Magento\Catalog\Model\ResourceModel\Category\Collection::joinUrlRewrite always use the store id from the store manager. I think that it should instead use the storeId set on the actual collection.

Description

Now joinUrlRewrite uses directly the storeManager, but if a store is set directly on the collection, it should use the store set, and not the default passed by the store manager.
The method getStoreId(), if not set, already goes on fallback to the store manager and get the default, so it should be safe to directly use getStoreId().

Fixed Issues (if relevant)

  1. Category\Collection::joinUrlRewrite should use the store set on the collection #13704: Category\Collection::joinUrlRewrite should use the store set on the collection

Manual testing scenarios

I already provided an automated unit test. There is an code example in the related issue #13704.
It's my first automated test here, so I hope it's ok :)

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)

@ihor-sviziev
Copy link
Contributor

Hi @rostyslav-hymon, could you add also changes from #14385?

it shall not pass code review as object under test is mocked and thus it does not test anything
@ihor-sviziev
Copy link
Contributor

Hi @rostyslav-hymon, I added commit from #14385 myself and approved your PR.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-1103 has been created to process this Pull Request

@okorshenko okorshenko modified the milestones: March 2018, April 2018 Apr 16, 2018
@magento-engcom-team magento-engcom-team merged commit 8220e3f into magento:2.3-develop May 6, 2018
magento-engcom-team pushed a commit that referenced this pull request May 6, 2018
magento-engcom-team pushed a commit that referenced this pull request May 6, 2018
magento-engcom-team pushed a commit that referenced this pull request May 6, 2018
@magento-engcom-team
Copy link
Contributor

Hi @rostyslav-hymon. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.3.0 release.

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.

7 participants