-
Notifications
You must be signed in to change notification settings - Fork 9.4k
ISSUE-27397 - Fix phrase handling in widget validation #28379
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
ISSUE-27397 - Fix phrase handling in widget validation #28379
Conversation
…translation phrase result as an error message
Hi @zaximus84. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
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. |
@magento run all tests |
app/code/Magento/Widget/Controller/Adminhtml/Widget/Instance/Validate.php
Outdated
Show resolved
Hide resolved
@magento run all tests |
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.
@zaximus84 please, cover changes with automated test
Risk set to low since the functionality may not affect other areas. |
@zaximus84 I'll take care of the test coverage. |
@magento run all tests |
Hi @ihor-sviziev, thank you for the review. |
✔️ QA Passed Manual testing scenario:
After ✔️ The error message appears with the text from the widget's validate method |
Hi @zaximus84, thank you for your contribution! |
Description (*)
The doc block in \Magento\Widget\Model\Widget\Instance::validate indicates that it can return a boolean or phrase object, but \Magento\Widget\Controller\Adminhtml\Widget\Instance\Validate doesn't handle the phrase object properly. This PR updates the controller to recognize a phrase result value as an error message and output it to the user.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)