Skip to content
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

Treat errors caused by core/shortcode blocks like non-block issues #6675

Merged
merged 5 commits into from
Nov 4, 2021

Conversation

delawski
Copy link
Collaborator

@delawski delawski commented Nov 2, 2021

Summary

Fixes #6667

This PR no longer treats errors generated by the core/shortcode block type as if they were WordPress core issues. Instead, all types of error sources are being examined in getErrorSourceTitle function in order to find the root cause of the issue.

Before After
Screenshot 2021-11-02 at 14 16 10 Screenshot 2021-11-02 at 14 16 32

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 source property of the blockSources object is being accessed instead of the type property, e.g.:

Screenshot 2021-11-02 at 14 58 50

Checklist

  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@delawski delawski added Bug Something isn't working Validation Editor labels Nov 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2021

Plugin builds for 8b0e968 are ready 🛎️!

@codecov
Copy link

codecov bot commented Nov 2, 2021

Codecov Report

Merging #6675 (180066e) into develop (0478c24) will increase coverage by 0.06%.
The diff coverage is 100.00%.

❗ Current head 180066e differs from pull request most recent head 79a4ed3. Consider uploading reports for the commit 79a4ed3 to get more accurate results
Impacted file tree graph

@@              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     
Flag Coverage Δ
javascript 57.77% <100.00%> (+0.17%) ⬆️
php 77.58% <ø> (+0.06%) ⬆️
unit 77.58% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...block-validation/components/error/error-content.js 93.33% <100.00%> (-0.22%) ⬇️
...idation/components/error/get-error-source-title.js 94.73% <100.00%> (+0.98%) ⬆️
includes/class-amp-service-worker.php 78.74% <0.00%> (ø)
includes/sanitizers/class-amp-link-sanitizer.php 85.71% <0.00%> (+13.54%) ⬆️

@westonruter
Copy link
Member

Confirmed fix to attribution:

Before After
Screen Shot 2021-11-04 at 12 22 25 Screen Shot 2021-11-04 at 12 23 00

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great other than the one small issue regarding the gutenberg slug.

@westonruter westonruter enabled auto-merge November 4, 2021 19:45
@westonruter westonruter added this to the v2.2 milestone Nov 4, 2021
@westonruter westonruter merged commit 46e0b76 into develop Nov 4, 2021
@westonruter westonruter deleted the fix/omit-gutenberg-in-editor-sidebar branch November 4, 2021 19:50
@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Changelogged Whether the issue/PR has been added to release notes. Editor Validation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore WordPress core when there is another error source in block editor AMP sidebar
2 participants