Skip to content

Replaced all escape functions from $block object to $escaper object as a part of Magento coding standards. #30639

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

Closed

Conversation

sanganinamrata
Copy link
Member

@sanganinamrata sanganinamrata commented Oct 24, 2020

Description (*)

Replaced all escape functions from $block object to $escaper object as a part of Magento coding standards.

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

N/A

Questions or comments

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 are green)

@m2-assistant
Copy link

m2-assistant bot commented Oct 24, 2020

Hi @sanganinamrata. 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

Copy link
Contributor

@rogyar rogyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sanganinamrata. Thank you for the refactoring. I believe it would be a good idea if we perform the replacement everywhere in the system and not only in particular modules. What do you think about that?

@ghost ghost assigned rogyar Oct 24, 2020
@rogyar rogyar added Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Progress: pending review Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. and removed Progress: needs update labels Oct 24, 2020
@sanganinamrata
Copy link
Member Author

sanganinamrata commented Oct 24, 2020

Sure @rogyar,

Right now I've covered blank and luma themes, but I'll cover Magento individual modules as well in 2-3 days in different PR to make both theme and modules updates in different.

@hostep
Copy link
Contributor

hostep commented Oct 25, 2020

@rogyar:

Hi @sanganinamrata. Thank you for the refactoring. I believe it would be a good idea if we perform the replacement everywhere in the system and not only in particular modules. What do you think about that?

I really don't like this to happen in minor releases (2.4.2 for example), it generates a lot of changes in frontend code which causes a whole lot of unnecessary noise when reviewing such an update and extra work when you need to upgrade to a new minor release and adjust your own custom frontend theme to follow the new changes. I prefer if big changes in hundreds or thousands of different phtml files only happen in major releases (like 2.5.0).

(This comment is irrelevant if only 10 or 20 files will be affected, but please if this affects more then 20 files, consider to only ship this in Magento 2.5.0)


The same thing happened in Magento 2.3.3, where a bunch of new coding standards got applied to all the phtml files and it caused just soo much overhead and extra work, I really like to not have this happen in minor releases in the future any longer, because it makes upgrades to a minor release really expensive, we should try to make minor releases easy and effortless so people will actually want to invest the time to upgrade to them.

Thanks for considering this! :)

@ihor-sviziev
Copy link
Contributor

Hi @rogyar,
I do agree with @hostep - in case if all the files will be refactored at once - please postpone these changes to 2.5.
Such consistency cleanups are very welcomed in case if someone will fix some issue in the file, but cleanup all together should be not in a patch versions.

@sanganinamrata
Copy link
Member Author

Hi @ihor-sviziev,

So Should I update this PR affected changes to Magento core modules as requested by @rogyar at #30639 (review) ?

@ihor-sviziev
Copy link
Contributor

I don't mind.
@rogyar what do you think?

@hostep
Copy link
Contributor

hostep commented Oct 29, 2020

It can probably be done, but just make sure the PR is not merged in 2.4-develop, we should wait until 2.5-develop becomes available before merging.

@sanganinamrata
Copy link
Member Author

@hostep Sure, I would love to do that.

@rogyar
Copy link
Contributor

rogyar commented Nov 4, 2020

@hostep @ihor-sviziev totally agree.
@sanganinamrata I would suggest closing this PR and creating a new one with all the replacements once we have 2.5-develop branch created.

Thanks

@hostep hostep mentioned this pull request Dec 28, 2020
4 tasks
@hostep
Copy link
Contributor

hostep commented Jan 8, 2021

Hi @sanganinamrata: Since the 2.5-develop branch is now open, could you change the target branch of this PR to 2.5-develop (or open a new PR targeting that branch if that's easier) and then try to update all offending code in the Magento codebase?
Thanks!

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Jan 21, 2021

Hi @sanganinamrata,
We have a PR that already approved and targeted to 2.5-develop #31663 that doing the same.
I'm closing this PR.

@m2-assistant
Copy link

m2-assistant bot commented Jan 21, 2021

Hi @sanganinamrata, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Design/Frontend Event: MageCONF CD 2020 Priority: P4 No current plan to fix. Fixing can be deferred as a logical part of more important work. Release Line: 2.4 Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants