-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Category\Collection::joinUrlRewrite should use the store set on the collection #13716
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
Category\Collection::joinUrlRewrite should use the store set on the collection #13716
Conversation
Hi @alepane21 thanks for this pull request. I will have a look at processing it now. |
@alepane21 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
Hi @alepane21 thank you for this PR. Would you be able to also add in an integration test to cover this change also? For an example I would suggest looking at |
Well, if you need it I think I can do it. But you'll have to wait this weekend. |
Hi @dmanners, done. There is an error in codacy but I think it's unrelated. |
Thank you @alepane21 for your hard work. I will take another look over this. |
Hi @dmanners, thank you for the review. |
…re set on the collection #13716
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)
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