Treat errors caused by core/shortcode blocks like non-block issues#6675
Merged
westonruter merged 5 commits intodevelopfrom Nov 4, 2021
Merged
Treat errors caused by core/shortcode blocks like non-block issues#6675westonruter merged 5 commits intodevelopfrom
core/shortcode blocks like non-block issues#6675westonruter merged 5 commits intodevelopfrom
Conversation
Contributor
|
Plugin builds for 8b0e968 are ready 🛎️!
|
Codecov Report
@@ Coverage Diff @@
## develop #6675 +/- ##
=============================================
+ Coverage 76.38% 76.45% +0.06%
- Complexity 6475 6476 +1
=============================================
Files 261 261
Lines 20697 20703 +6
=============================================
+ Hits 15809 15828 +19
+ Misses 4888 4875 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
|
2 tasks
Member
westonruter
requested changes
Nov 4, 2021
Member
westonruter
left a comment
There was a problem hiding this comment.
Looks great other than the one small issue regarding the gutenberg slug.
assets/src/block-validation/components/error/test/get-error-source-title.js
Outdated
Show resolved
Hide resolved
assets/src/block-validation/components/error/get-error-source-title.js
Outdated
Show resolved
Hide resolved
westonruter
reviewed
Nov 4, 2021
assets/src/block-validation/components/error/get-error-source-title.js
Outdated
Show resolved
Hide resolved
westonruter
approved these changes
Nov 4, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Fixes #6667
This PR no longer treats errors generated by the
core/shortcodeblock type as if they were WordPress core issues. Instead, all types of error sources are being examined ingetErrorSourceTitlefunction in order to find the root cause of the issue.On top of that, Gutenberg is returned as a Source only if it is the sole source of an error (the same logic is used in the other areas of the plugin).
Moreover, this PR fixes an issue where an inexistent
sourceproperty of theblockSourcesobject is being accessed instead of thetypeproperty, e.g.:Checklist