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

Fix translations of category design theme not being applied #17854

Merged

Conversation

@cezary-zeglen
Copy link
Contributor

cezary-zeglen commented Aug 29, 2018

Description

Currently if you enable custom design theme for category the translations of selected theme are not used. This commit fixes the problem.

Fixed Issues (if relevant)

#17625

Manual testing scenarios

(Copied from #17625 )

  1. Enable Magento_Blank for the website
  2. Create a category and set Magento_Luma as it's theme
  3. Add a translation to the /i18n/ directory of Magento_Luma
  4. Flush caches
  5. The translation is now not applied.
    Commit changes point 5. so the translation is being applied

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

This comment has been minimized.

Copy link
Contributor

magento-cicd2 commented Aug 29, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

magento-engcom-team commented Aug 29, 2018

Hi @cezary-zeglen. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

app/code/Magento/Catalog/Model/Design.php Outdated Show resolved Hide resolved
app/code/Magento/Catalog/Model/Design.php Outdated Show resolved Hide resolved
app/code/Magento/Catalog/Model/Design.php Outdated Show resolved Hide resolved
lib/internal/Magento/Framework/Translate.php Outdated Show resolved Hide resolved
@cezary-zeglen

This comment has been minimized.

Copy link
Contributor Author

cezary-zeglen commented Aug 30, 2018

@phoenix128 Thanks for the code review, I thought I should stick to the old coding conventions when modifying old classes. I'll commit fixes sometime this week.

@phoenix128

This comment has been minimized.

Copy link
Contributor

phoenix128 commented Aug 30, 2018

Hello @cezary-zeglen ,
thank you for your time. It is really appreciated. Please also refer to the static tests errors.

@phoenix128 phoenix128 removed their assignment Sep 17, 2018
@sidolov

This comment has been minimized.

Copy link
Contributor

sidolov commented Sep 18, 2018

Hi @cezary-zeglen , looks like that you made a commit with a different email than in the GitHub profile. Please, add email from commit to your profile or make a new commit with the email from profile and force push the branch. Also, please, sign CLA, otherwise we can't proceed with your PR.
Thank you!

@cezary-zeglen

This comment has been minimized.

Copy link
Contributor Author

cezary-zeglen commented Sep 20, 2018

Hi @cezary-zeglen , looks like that you made a commit with a different email than in the GitHub profile. Please, add email from commit to your profile or make a new commit with the email from profile and force push the branch. Also, please, sign CLA, otherwise we can't proceed with your PR.
Thank you!

@sidolov Yeah, sorry about that. When I'll find a bit of time I'll fix issues with the code and just squash all the commits. BTW, I have a question regarding the workflow here. I'm used to pushing commits, checking reports for test results, fixing and then setting commit in gerrit to special status to announce to my reviewers that the commit awaits code review. This way noone is bothered with the commit untill I set its status to the correct one. How does it work here? I don't want to bother people with my work in progress commits but I also don't see that much need for setting up all tests locally.

@cezary-zeglen cezary-zeglen force-pushed the cezary-zeglen:fix/categorytranslation branch from 99092e2 to 032d07b Sep 25, 2018
@sidolov

This comment has been minimized.

Copy link
Contributor

sidolov commented Oct 2, 2018

Hi @cezary-zeglen , we are expecting that newly created PR us ready to review (all tests passed, solution well tested, etc). I understand that in some cases you don't know about scenarios that can be affected by fix, you need to submit the PR and wait for a Travis. In that case, we can wait for the test results and drop you a message in something went wrong.

@slavvka

This comment has been minimized.

Copy link
Member

slavvka commented Oct 3, 2018

Hey @cezary-zeglen. Thank you for your contribution. Test Magento\Catalog\Model\DesignTest::testApplyCustomDesign seems to be failing due to your changes. Please fix it before we can proceed.

@slavvka slavvka self-assigned this Oct 3, 2018
@cezary-zeglen

This comment has been minimized.

Copy link
Contributor Author

cezary-zeglen commented Oct 10, 2018

@slavvka I know, sorry it takes so much time for me to commit a fix but I'll try to find time this week to take care of this.

@slavvka

This comment has been minimized.

Copy link
Member

slavvka commented Oct 10, 2018

@cezary-zeglen okay, thank you for the efforts!

@cezary-zeglen cezary-zeglen force-pushed the cezary-zeglen:fix/categorytranslation branch 3 times, most recently from fbf3fd0 to 40c2a9c Oct 15, 2018
Copy link
Member

slavvka left a comment

@cezary-zeglen thank you the changes. But I have comments so please fix it.

lib/internal/Magento/Framework/Translate.php Outdated Show resolved Hide resolved
lib/internal/Magento/Framework/TranslateInterface.php Outdated Show resolved Hide resolved
@cezary-zeglen

This comment has been minimized.

Copy link
Contributor Author

cezary-zeglen commented Oct 29, 2018

@slavvka Sorry but I'm not sure if I understand correctly, so you want me just to improve the unit tests or also to remove the setter and reimplement the whole bugfix?

@slavvka

This comment has been minimized.

Copy link
Member

slavvka commented Oct 29, 2018

@slavvka Sorry but I'm not sure if I understand correctly, so you want me just to improve the unit tests or also to remove the setter and reimplement the whole bugfix?

@cezary-zeglen Sorry, I really missed that you use the added method in the solution. So you are right, you don't need to update Translate classa and its test. But could you please consider covering the change in Design class with integration test since it is serious changes that may affect whole application?

@cezary-zeglen

This comment has been minimized.

Copy link
Contributor Author

cezary-zeglen commented Oct 31, 2018

@slavvka Ok, now this is embarassing - I realized that force reloading translator is enough to fix this bug. Do you want me to squash all of these commits or leave it as is?

@cezary-zeglen cezary-zeglen force-pushed the cezary-zeglen:fix/categorytranslation branch 2 times, most recently from 72005d7 to 57bb789 Oct 31, 2018
@slavvka

This comment has been minimized.

Copy link
Member

slavvka commented Oct 31, 2018

@slavvka Ok, now this is embarrassing - I realized that force reloading translator is enough to fix this bug. Do you want me to squash all of these commits or leave it as is?

@cezary-zeglen Yep, but that's wonderful since the time could give you the possibility to dramatically improve your solution!

Yes, please squash it to make this PR even more ideal :) Also after having all tests passed could you please to up-port it to 2.3 as we want to all fixes to be delivered to 2.3 firstly. Then we could deliver this PR as well.

@cezary-zeglen cezary-zeglen force-pushed the cezary-zeglen:fix/categorytranslation branch from 57bb789 to f6eb7fb Nov 1, 2018
@slavvka
slavvka approved these changes Nov 8, 2018
@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

magento-engcom-team commented Nov 8, 2018

Hi @slavvka, thank you for the review.
ENGCOM-3415 has been created to process this Pull Request

@magento-engcom-team magento-engcom-team merged commit f6eb7fb into magento:2.2-develop Nov 12, 2018
2 of 3 checks passed
2 of 3 checks passed
Codacy/PR Quality Review Codacy was unable to analyse your pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
magento-engcom-team pushed a commit that referenced this pull request Nov 12, 2018
…ied #17854
@magento-engcom-team magento-engcom-team added this to Ready to Port in Ports Wanted Nov 12, 2018
@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

magento-engcom-team commented Nov 12, 2018

Hi @cezary-zeglen. Thank you for your contribution.
We will aim to release these changes as part of 2.2.8.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@sidolov sidolov moved this from Ready to Port to Port to 2.3 Merged in Ports Wanted Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Ports Wanted
  
Port to 2.3 Merged
6 participants
You can’t perform that action at this time.