WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.34k stars 4.13k forks source link

Cover Block: fixed background issue #59980

Open jt-kms opened 6 months ago

jt-kms commented 6 months ago

Description

After a user who is not the Super Admin of a multisite adds a cover block and inserts an external image from the code editor, they activate the 'fixed background' option in media settings in visual editor view and save the post. Upon refreshing the page, an error occurs with the block.

example)

<!-- wp:cover {"url":"https://images.unsplash.com/photo-1532704868953-d85f24176d73?ixid=M3w0NzI4ODN8MHwxfHNlYXJjaHwyMHx8b3JnYW5pYyUyMG1hcmtldHxlbnwwfHx8fDE3MTA0NjAyNzB8MA\u0026amp;ixlib=rb-4.0.3\u0026amp;w=1816\u0026amp;h=800\u0026amp;fit=crop","dimRatio":50,"contentPosition":"top left","align":"full","layout":{"type":"default"}} -->
<div class="wp-block-cover alignfull has-custom-content-position is-position-top-left"><span aria-hidden="true" class="wp-block-cover__background has-background-dim"></span><img class="wp-block-cover__image-background" alt="" src="https://images.unsplash.com/photo-1532704868953-d85f24176d73?ixid=M3w0NzI4ODN8MHwxfHNlYXJjaHwyMHx8b3JnYW5pYyUyMG1hcmtldHxlbnwwfHx8fDE3MTA0NjAyNzB8MA&amp;ixlib=rb-4.0.3&amp;w=1816&amp;h=800&amp;fit=crop" data-object-fit="cover" /><div class="wp-block-cover__inner-container"><!-- wp:heading {"textAlign":"left"} -->
<h2 class="wp-block-heading has-text-align-left">Fixed Background Test</h2>
<!-- /wp:heading --></div></div>
<!-- /wp:cover -->

Step-by-step reproduction instructions

  1. Log in to the multisite with an account that is not a Super Admin.
  2. Navigate to the Gutenberg editor screen of the site.
  3. Add a Cover block to the editor.
  4. In the Code editor screen of the editor, change the image path to an external URL.
  5. Switch back to the visual editor and activate the 'fixed background' option.
  6. Update the post.
  7. Execute a refresh.
  8. An error occurs.

Screenshots, screen recording, code snippet

https://github.com/WordPress/gutenberg/assets/74164656/9fa316c4-3ab8-477f-b1bc-97ed2c1bc576

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

fabiankaegy commented 6 months ago

I can replicate this issue. But given that I can also replicate it on WordPress 6.4.3 as also called out in the initial report I am removing it from the 6.5 board.

We are less than one week away from release and in the RC phase where only really critical bugs can get fixed.

That doesn't mean that this issue is not important / something we shouldn't look into. Just that it won't get included in the 6.5 release.

github-actions[bot] commented 5 months ago

Hi, This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.