-
Notifications
You must be signed in to change notification settings - Fork 219
Decode HTML entities when formatting Store API error messages #5870
Conversation
Size Change: -174 B (0%) Total Size: 863 kB
ℹ️ View Unchanged
|
Script Dependencies ReportThe
This comment was automatically generated by the |
Script Dependencies ReportThe
This comment was automatically generated by the |
Script Dependencies ReportThe
This comment was automatically generated by the |
@@ -50,7 +51,7 @@ const StoreNoticesContainer = ( { className, notices, removeNotice } ) => { | |||
} | |||
} } | |||
> | |||
{ props.content } | |||
{ decodeEntities( props.content ) } |
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.
Hey @manospsyx - I discussed briefly with @xristos3490 and he suggested using decodeEntities
in one place (here - the store notices container) rather than everywhere else we call createNotice
What do you think?
I tested it locally and it works as expected (with decodeEntities
in assets/js/base/utils/errors.js
removed). If you agree, we can revert errors.js
and just keep the change in the container.
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 remember there's at least one instance where decodeEntities
is used outside -- I wasn't sure if that's intentional. I agree with Chris, but let's make sure that we're not double-decoding in other places. Can you check usage of decodeEntities
in other locations to make sure?
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.
As discussed with @senadir over slack
My personal preference is to not call something unless needed seeing that you can't opt out of it in a clean way, I think decoding all server returned stings makes more sense than decoding at the createNotice level.
Script Dependencies ReportThe
This comment was automatically generated by the |
Script Dependencies ReportThe
This comment was automatically generated by the |
Script Dependencies ReportThe
This comment was automatically generated by the |
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.
Remove #5870 testing notes because they can't be tested as a user
* Empty commit for release pull request * Add Changelog to readme.txt * Update WC tested and required versions * Add testing notes * Register missing C&C inner blocks and update fallback template for older C& C versions (#6195) * Register missing C & C inner blocks and update fallback template for older C & C versions This will fix the issues with missing order summary inner blocks: Coupons (both in C & C blocks) and the Cart header. The issue was happening because, for example, for Cart the coupons were registred on the on frontend, but it just wasn't forced in the attributes. Because it also wasn't added to the PHP fallback layout, the render function didn't include it. For the Checkout block the coupons inner block wasn't registered at all. * Revert changes to Checkout.php, we don't need to test for inner blocks * Revert "Revert changes to Checkout.php, we don't need to test for inner blocks" This reverts commit fc39535. * Fix the returned template for older Checkout block iterations * Fix Cart and Checkout templates to accommodate the Summary order inner blocks * Hide coupon form div from inner blocks if coubons are not enabled * Fix checkout coupon tests in checkout They have been written for logged in user * Fix Order Summary Heading inner block's default text * Update comments with better wording * Revert "Hide coupon form div from inner blocks if coubons are not enabled" This reverts commit ab09021. (cherry picked from commit 40180ae) * Update the zip file link * Update testing instructions * Remove experimental build related PR from testing notes * Fix/order summary sidebar css (#6231) * Add box sizing to Totals item * Add some unit tests for Order summary blocks * Fix Proceed to checkout button size (cherry picked from commit 669aee7) * Update the WC required/tested versions * Mini Cart Contents: Use block pattern to make the empty cart message translatable (#6248) * try: use block pattern to make empty cart message translatable * Update src/BlockTypes/MiniCart.php Co-authored-by: Albert Juhé Lluveras <[email protected]> * rename function Co-authored-by: Albert Juhé Lluveras <[email protected]> Co-authored-by: Luigi <[email protected]> (cherry picked from commit cfe73f1) * Update the release's ZIP file * Update testing notes In #6065, for Cart only Order Summary Heading & Coupon form can be removed, and for Checkout only the Coupon form. * Update the testing notes Remove #5870 testing notes because they can't be tested as a user * Update Testing notes Add screenshots to the #5967 testing notes * Remove #6166 testing instructions We reverted this PR * Revert (#6166) (#6253) Revert "Prevent Featured Product block from breaking when product is out of stock + hidden from catalog (#6166)" This reverts commit 3c0e0af (cherry picked from commit 908526e) * Bumping version strings to new version. Co-authored-by: github-actions <[email protected]> Co-authored-by: Saad Tarhi <[email protected]> Co-authored-by: Raluca Stan <[email protected]> Co-authored-by: Luigi Teschio <[email protected]> Co-authored-by: Tung Du <[email protected]>
Fixes #5869
Accessibility
prefers-reduced-motion
Other Checks
Screenshots
See #5869
Testing
Automated Tests
Manual Testing
How to test the changes in this Pull Request:
User Facing Testing
These are steps for user testing (where "user" is someone interacting with this change that is not editing any code).
Performance Impact
Changelog