Skip to content

[backport 2.1] Category\Collection::joinUrlRewrite should use the store set on the collection #13756

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
merged 3 commits into from
May 30, 2018
Merged

[backport 2.1] Category\Collection::joinUrlRewrite should use the store set on the collection #13756

merged 3 commits into from
May 30, 2018

Conversation

alepane21
Copy link
Contributor

@alepane21 alepane21 commented Feb 20, 2018

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)

@alepane21
Copy link
Contributor Author

@orlangur Now that I've fixed the tests, should also remove the on hold label?

Thanks!

@orlangur
Copy link
Contributor

Hi @alepane21, it's on hold because PR to 2.2-develop needs to be processed first. If there was a need to adjust tests, the label would be needs update :)

@alepane21
Copy link
Contributor Author

Hi, could this be merged in the march milestone?

Thanks!

@dmanners
Copy link
Contributor

dmanners commented Apr 3, 2018

Hi @alepane21 now that the original PR has been merged in. Would you be so kind as to update this PR with those changes and we can sort this out as well.

Thank you.

@magento-engcom-team magento-engcom-team added this to the Release: 2.1.15 milestone May 25, 2018
@magento-engcom-team magento-engcom-team merged commit 915be6e into magento:2.1-develop May 30, 2018
magento-engcom-team pushed a commit that referenced this pull request May 30, 2018
magento-engcom-team pushed a commit that referenced this pull request May 30, 2018
magento-engcom-team pushed a commit that referenced this pull request May 30, 2018
…re set on the collection #13756

- fix integration test
@magento-engcom-team
Copy link
Contributor

Hi @alepane21. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.1.15 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.

5 participants