Automattic / Automattic/jetpack

Tiled gallery breaks when converted from Classic Editor

Open
#16,947 7 comments 0 reactions 0 assignees View on GitHub
[Block] Tiled Gallery [Pri] Normal Bug Customer Report [LEGACY]
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

#### Steps to reproduce the issue

1. Find an old post with a tiled gallery:
https://www.dropbox.com/s/xn3vddkyl7l9187/tiled0_cr.jpg?dl=0

2. Edit the post and push it to Block Editor. Convert the Classic to blocks. Note that your tiled gallery came in as a regular gallery. Duplicate that gallery. Now you have two WordPress galleries:
https://www.dropbox.com/s/otkzu674tvzpx3y/tiled2_cr.jpg?dl=0

3. Convert the second image gallery to a Tiled Gallery, note that the display reflects that in the editor:
https://www.dropbox.com/s/et12325nvldf3a5/tiled4_cr.jpg?dl=0

4. Preview the post and note that the tiled gallery is missing in its entirety:
https://www.dropbox.com/s/2gpbg1gchy3ffcq/tiled5_cr.jpg?dl=0

If you simply convert one image gallery and update the post you will most likely lose even the image gallery and the included image information.

Quite a while back, I reported this problem and it was taken care of. But, the latest updates messed them up again.

The code view shows the tiled gallery in the classic editor becomes a WordPress gallery, and when it block type is changed to the tiled gallery again has a very long part missing. Here is what the code view shows:
< ! -- wp:jetpack/tiled-gallery {"ids":[12609,12611,12612,12613,12610],"linkTo":"media"} /-->

and that code displays a tiled gallery that "appears" to be correct, but it is not.

A properly inserted tiled-gallery in the block editor yields:
< ! -- wp:jetpack/tiled-gallery {"columnWidths":[[66.8426350205179,33.1573649794821],[50,50]],"ids":[12613,12612,12611,12609,12610]} -->

followed by a long code section of a series of div code blocks.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Classic Editor-to-Block Editor conversion using an old post with a tiled gallery, then compare the converted gallery, the Tiled Gallery block markup, and the preview output. Start with the gallery conversion and rendering entry points; done means converting and previewing the post preserves the tiled gallery and its image information without losing the gallery.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, wordpress
Domain
content, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.