Fix block validation on WordPress 6.2#272
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #272 +/- ##
=======================================
Coverage 9.37% 9.37%
Complexity 4288 4288
=======================================
Files 266 266
Lines 33159 33159
=======================================
Hits 3108 3108
Misses 30051 30051
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2d475aa to
e91e965
Compare
e91e965 to
f2f82a2
Compare
cbravobernal
left a comment
There was a problem hiding this comment.
LGTM. But maybe we should increase the minimum WP Version.
What
Fixes block validation failing on WordPress 6.2, allowing posts to publish despite validation errors in blocks.
Why
While working on #271 to make e2e tests compatible with WP 6.2, one test failed for a valid reason related to production code:
togglePublishSidebar()was added in WordPress 6.3 and doesn't exist in 6.2. The error broke the promise chain before it could returnhasError = true. This caused the validation to silently fail, allowing posts with invalid blocks to be published.How
Checking if
togglePublishSidebarexists before calling it:Testing Instructions