-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Chore: Catalog Widget - Replace Block Escaping with Escaper #37082
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
Conversation
Hi @pykettk. Thank you for your contribution! Add the comment under your pull request to deploy test or vanilla Magento instance:
❗ Automated tests can be triggered manually with an appropriate comment:
Allowed build names are:
You can find more information about the builds here For more details, review the Code Contributions documentation. |
@magento create issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @pykettk
Thank you for your contribution here.
✔️ QA Passed Preconditions:
Manual testing scenario:
and Before: ✖️ Additionally tested:
No additional manual testing is required as a part of regression cycle as this PR is related to the refactoring of the code base. As builds are failed. Hence, moving this PR to Extended testing |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Static Tests, Unit Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
2 similar comments
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
1 similar comment
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi @pykettk, Thank you for the contribution! As your branch is forked from https://github.com/mage-os/mageos-magento2.git, we can not able to work on it. Can you please have a look at them else we have to create a new PR from branch forked from https://github.com/magento/magento2.git and close this one. Thank you! |
@engcom-Charlie What changes would you like me to make? |
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi @pykettk ,
In order to move ahead to merge in progress all builds should be green. As build is failing our team have to work on it but as your PR is forked from mage-os we can't proceed further on it. Thanks |
@engcom-Lima Your response doesn't answer the question. |
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Hi @pykettk, In general, when PR is showing build failures, we need to work on it. It will get move to Merge only when the build is successful. For this PR, we engcom team, not able to work on your PR as your branch is forked from https://github.com/mage-os/mageos-magento2.git As mentioned in comment, either you please have a look at the build failures or please raise a new PR from branch forked from https://github.com/magento/magento2.git and close this one. Thank you! |
@engcom-Charlie I'd really like to look at the failing checks however the report is unavailable - see below. Please advise. |
@magento run Static Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've manually run vendor/bin/phpcs --standard=Magento2Framework -sp --basepath=$PWD --colors app/code/Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml app/code/Magento/CatalogWidget/view/adminhtml/templates/product/widget/conditions.phtml
and this is what it is complaining about:
FILE: app/code/Magento/CatalogWidget/view/adminhtml/templates/product/widget/conditions.phtml
--------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------------------------------------
17 | WARNING | Line exceeds 120 characters; contains 122 characters
| | (Generic.Files.LineLength.TooLong)
40 | WARNING | Line exceeds 120 characters; contains 123 characters
| | (Generic.Files.LineLength.TooLong)
--------------------------------------------------------------------------------------------------------
I suspect this is why the automated Static Tests are failing. There were no complains from vendor/bin/phpmd
which is also run as part of the automated Static Tests.
$fieldId = $element->getHtmlContainerId() ? ' id="' . $block->escapeHtmlAttr($element->getHtmlContainerId()) . '"' : ''; | ||
$fieldClass = 'field admin__field field-' . $block->escapeHtmlAttr($element->getId()) . ' ' | ||
. $block->escapeHtmlAttr($element->getCssClass()); | ||
$fieldId = $element->getHtmlContainerId() ? ' id="' . $escaper->escapeHtmlAttr($element->getHtmlContainerId()) . '"' : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpcs
says this line is too long (122 characters, limit is 120)
@@ -31,8 +37,8 @@ $fieldAttributes = $fieldId . ' class="' . $fieldClass . '" ' | |||
"Magento_Rule/rules", | |||
"prototype" | |||
], function(VarienRulesForm){ | |||
window.{$block->escapeJs($block->getHtmlId())} = new VarienRulesForm('{$block->escapeJs($block->getHtmlId())}', | |||
'{$block->escapeUrl($block->getNewChildUrl())}'); | |||
window.{$escaper->escapeJs($block->getHtmlId())} = new VarienRulesForm('{$escaper->escapeJs($block->getHtmlId())}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpcs
says this line is too long (123 characters, limit is 120)
Note that I have magento/magento-coding-standard#417 applied locally, so when I say |
Thanks for the input, @fredden , this is very helpful! I'll look to get these resolved now 🙂 |
Description (*)
Refactors the
Magento_CatalogWidget
module to replace$block
escaping functions with$escaper
escaping functions.Contribution checklist (*)
Resolved issues: