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

Improve display of error returned from the REST API when an unsupported image type is uploaded #68788

Merged
Merged
Prev Previous commit
Next Next commit
Fix settings to match file.type
  • Loading branch information
adamsilverstein committed Jan 13, 2025
commit 605bf3255aa695970a89fa77e7a28942fd6e9b34
6 changes: 3 additions & 3 deletions lib/block-editor-settings.php
Original file line number Diff line number Diff line change
@@ -93,17 +93,17 @@ function gutenberg_get_block_editor_settings( $settings ) {

// Check if WebP images can be edited.
if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/webp' ) ) ) {
$settings['typesNotSupportedByServer']['webp'] = true;
$settings['typesNotSupportedByServer']['image/webp'] = true;
}

// Check if AVIF images can be edited.
if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/avif' ) ) ) {
$settings['typesNotSupportedByServer']['avif'] = true;
$settings['typesNotSupportedByServer']['image/avif'] = true;
}

// Check if HEIC images can be edited.
if ( ! wp_image_editor_supports( array( 'mime_type' => 'image/heic' ) ) ) {
$settings['typesNotSupportedByServer']['heic'] = true;
$settings['typesNotSupportedByServer']['image/heic'] = true;
}

$settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() );

Unchanged files with check annotations Beta

const contentAfter =
await templateRevertUtils.getCurrentSiteEditorContent();
expect( contentAfter ).toEqual( contentBefore );

Check failure on line 102 in test/e2e/specs/site-editor/template-revert.spec.js

GitHub Actions / Playwright - 6

[chromium] › site-editor/template-revert.spec.js:82:2 › Template Revert › should show the original content after revert and page reload

1) [chromium] › site-editor/template-revert.spec.js:82:2 › Template Revert › should show the original content after revert and page reload Error: expect(received).toEqual(expected) // deep equality - Expected - 9 + Received + 8 - <!-- wp:template-part {"slug":"header","tagName":"header","theme":"emptytheme"} /--> + <!-- wp:template-part {"slug":"header","theme":"emptytheme","tagName":"header"} /--> - <!-- wp:query {"queryId":1,"query":{"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","sticky":""}} --> + + <!-- wp:query {"queryId":1,"query":{"offset":0,"postType":"post","order":"desc","orderBy":"date","author":"","search":"","sticky":"","perPage":10}} --> - <div class="wp-block-query"> - <!-- wp:post-template --> + <div class="wp-block-query"><!-- wp:post-template --> - <!-- wp:post-title {"isLink":true} /--> + <!-- wp:post-title {"isLink":true} /--> - <!-- wp:post-excerpt /--> + + <!-- wp:post-excerpt /--> - <!-- /wp:post-template --> - </div> + <!-- /wp:post-template --></div> <!-- /wp:query --> - 100 | const contentAfter = 101 | await templateRevertUtils.getCurrentSiteEditorContent(); > 102 | expect( contentAfter ).toEqual( contentBefore ); | ^ 103 | } ); 104 | 105 | test( 'should show the edited content after revert and clicking undo in the header toolbar', async ( { at /home/runner/work/gutenberg/gutenberg/test/e2e/specs/site-editor/template-revert.spec.js:102:26
} );
test( 'should show the edited content after revert and clicking undo in the header toolbar', async ( {