Skip to content

Conversation

alepane21
Copy link
Contributor

@alepane21 alepane21 commented Feb 18, 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)

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Feb 18, 2018

CLA assistant check
All committers have signed the CLA.

@dmanners
Copy link
Contributor

Hi @alepane21 thanks for this pull request. I will have a look at processing it now.

@magento-engcom-team
Copy link
Contributor

@alepane21 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@alepane21 alepane21 requested review from mzeis and removed request for mzeis February 20, 2018 19:20
@okorshenko okorshenko modified the milestones: February 2018, March 2018 Mar 1, 2018
@dmanners
Copy link
Contributor

dmanners commented Mar 8, 2018

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 app/code/Magento/Catalog/Model/ResourceModel/Category/Collection.php::testJoinTable

@alepane21
Copy link
Contributor Author

Well, if you need it I think I can do it. But you'll have to wait this weekend.

@alepane21
Copy link
Contributor Author

Hi @dmanners, done. There is an error in codacy but I think it's unrelated.

@dmanners
Copy link
Contributor

Thank you @alepane21 for your hard work. I will take another look over this.

@magento-engcom-team
Copy link
Contributor

Hi @dmanners, thank you for the review.
MAGETWO-88107 has been created to process this Pull Request

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