Wp-calypso: Refreshing breaks Tiled Gallery display in Block Editor

Created on 24 Jan 2019  路  5Comments  路  Source: Automattic/wp-calypso

Steps to reproduce

  1. Starting at URL: Create a new post at wordpress.com/post or /wp-admin/post.php using the Block Editor
  2. Add a Tiled Gallery block with images
  3. Make sure the draft is saved automatically or manually
  4. Refresh and see a "This block has encountered an error and cannot be previewed." message where the block should be. If you proceed to publish the gallery still displays on the front-end

What I expected

The gallery to still display in the Block Editor

What happened instead

The error "This block has encountered an error and cannot be previewed."

Switching to the code editor the code changes from the following when it works:

<!-- wp:jetpack/tiled-gallery {"ids":[175447107,175447106,175447105]} -->
<div class="wp-block-jetpack-tiled-gallery aligncenter is-style-rectangular"><div class="tiled-gallery__gallery"><div class="tiled-gallery__row"><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" aria-label="image 1 of 3 in gallery" data-height="640" data-id="175447107" data-link="https://k2testblog.wordpress.com/gallery/attachment/9/" data-url="https://k2testblog.files.wordpress.com/2019/01/9.jpg?w=820" data-width="1920" src="https://k2testblog.files.wordpress.com/2019/01/9.jpg"/></figure></div></div><div class="tiled-gallery__row"><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" aria-label="image 2 of 3 in gallery" data-height="640" data-id="175447106" data-link="https://k2testblog.wordpress.com/gallery/attachment/8/" data-url="https://k2testblog.files.wordpress.com/2019/01/8.jpg?w=820" data-width="1920" src="https://k2testblog.files.wordpress.com/2019/01/8.jpg"/></figure></div></div><div class="tiled-gallery__row"><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" aria-label="image 3 of 3 in gallery" data-height="640" data-id="175447105" data-link="https://k2testblog.wordpress.com/gallery/attachment/7/" data-url="https://k2testblog.files.wordpress.com/2019/01/7.jpg?w=820" data-width="1920" src="https://k2testblog.files.wordpress.com/2019/01/7.jpg"/></figure></div></div></div></div>
<!-- /wp:jetpack/tiled-gallery -->

To this when it doesn't after refreshing:

<!-- wp:jetpack/tiled-gallery {"ids":[175447107,175447106,175447105]} -->
<div class="wp-block-jetpack-tiled-gallery aligncenter is-style-rectangular"><div class="tiled-gallery__gallery"><div class="tiled-gallery__row"><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" aria-label="image 1 of 3 in gallery" data-id="175447107" data-link="https://k2testblog.wordpress.com/gallery/attachment/9/" src="https://k2testblog.files.wordpress.com/2019/01/9.jpg" /></figure></div></div><div class="tiled-gallery__row"><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" aria-label="image 2 of 3 in gallery" data-id="175447106" data-link="https://k2testblog.wordpress.com/gallery/attachment/8/" src="https://k2testblog.files.wordpress.com/2019/01/8.jpg" /></figure></div></div><div class="tiled-gallery__row"><div class="tiled-gallery__col"><figure class="tiled-gallery__item"><img alt="" aria-label="image 3 of 3 in gallery" data-id="175447105" data-link="https://k2testblog.wordpress.com/gallery/attachment/7/" src="https://k2testblog.files.wordpress.com/2019/01/7.jpg" /></figure></div></div></div></div>
<!-- /wp:jetpack/tiled-gallery -->

Note the date-width, data-height, and data-url all missing post-refresh. I was not able to reproduce this on an Atomic site using the core Block Editor.

Browser / OS version

Chrome 70.0.3538.11
OS X 10

Screenshot / Video

Before refreshing

screen shot 2019-01-24 at 3 56 54 pm

After refreshing

screen shot 2019-01-24 at 3 57 07 pm

Context / Source

manual-testing, #user-report

Tiled Galleries [Goal] Gutenberg [Pri] High [Type] Bug

Most helpful comment

/cc @Automattic/gutenpack

All 5 comments

/cc @Automattic/gutenpack

A few questions to confirm to help us track this down:

  • This is happening in the Calypso block editor for a Simple site, is that correct?
  • What is the user role used to create the post?

I tested this a bit, and I am able to reproduce this both on Gutenlypso (Gutenberg on Calypso) and on Calypsoified Gutenberg ({site}/wp-admin/post-new.php).

Tested on a simple site. Admin role.

Same with Author role.

Contributor role doesn't seem to have the ability to upload/manage media - so doesn't matter.

screenshot 2019-01-25 at 14 46 35

On Atomic though, I am not seeing this behaviour. On refreshing the tiled gallery block appears fine. 馃憤馃徑

This regression seems to come from a change to the way attributes are filtered. Details in p3btAN-12t-p2

cc: @xknown

Fixed by D23530-code

Was this page helpful?
0 / 5 - 0 ratings