Impact
Crashes the whole block editor — the full-screen "The editor has encountered an unexpected error" boundary. Reproducible 100% of the time on the round-trip described below. In the non-crashing case the same code path silently drops the gallery's images.
Steps to reproduce
- New post. Add a Tiled Gallery block with a few images.
- Select it → block switcher → Transform to → Gallery. (works fine)
- Select the resulting Gallery block and open the block-type switcher (or Transform to → Tiled Gallery).
- The editor crashes immediately — it throws as soon as the switcher renders the Tiled Gallery transform preview.
Expected
The Gallery converts back to a Tiled Gallery, preserving its images.
Actual
Full-screen "The editor has encountered an unexpected error".
Console / stack
TypeError: Cannot read properties of undefined (reading 'filter')
at f (jetpack/_inc/blocks/editor.js) // image filter helper
at transform (jetpack/_inc/blocks/editor.js) // tiled-gallery "from: core/gallery"
at switchToBlockType → block-switcher preview → React render
Root cause
The Tiled Gallery from: ['core/gallery', 'jetpack/slideshow'] transform (extensions/blocks/tiled-gallery/transforms.js) does roughly:
transform: ( { images } ) => {
const filtered = images.filter( ( { id, url } ) => id && url );
...
}
After Tiled → Gallery, the intermediate v2 core/gallery stores its images in nested core/image inner blocks and leaves the top-level images attribute undefined, so images.filter() throws.
The same root assumption means the transform silently produces an empty Tiled Gallery for any modern (v2) gallery whose top-level images array is empty.
Suggested fix
Default images, and recover it from innerBlocks (the transform already receives them) so the images survive the round-trip:
transform: ( { images = [] }, innerBlocks ) => {
if ( ! images.length && innerBlocks?.length ) {
images = innerBlocks
.filter( ( b ) => b.name === 'core/image' && b.attributes?.url )
.map( ( { attributes } ) => ( {
id: attributes.id, url: attributes.url,
link: attributes.link, alt: attributes.alt,
} ) );
}
const filtered = images.filter( ( { id, url } ) => id && url );
...
}
Environment
- Jetpack 15.9
- WordPress 7.0
- Reproduces with only Jetpack active (no other plugins needed)
- Workaround: reload the post between the Tiled→Gallery and Gallery→Tiled steps. A freshly parsed gallery has
images: [] rather than undefined, so it no longer crashes (though images are still dropped).
Impact
Crashes the whole block editor — the full-screen "The editor has encountered an unexpected error" boundary. Reproducible 100% of the time on the round-trip described below. In the non-crashing case the same code path silently drops the gallery's images.
Steps to reproduce
Expected
The Gallery converts back to a Tiled Gallery, preserving its images.
Actual
Full-screen "The editor has encountered an unexpected error".
Console / stack
Root cause
The Tiled Gallery
from: ['core/gallery', 'jetpack/slideshow']transform (extensions/blocks/tiled-gallery/transforms.js) does roughly:After Tiled → Gallery, the intermediate v2
core/gallerystores its images in nestedcore/imageinner blocks and leaves the top-levelimagesattributeundefined, soimages.filter()throws.The same root assumption means the transform silently produces an empty Tiled Gallery for any modern (v2) gallery whose top-level
imagesarray is empty.Suggested fix
Default
images, and recover it frominnerBlocks(the transform already receives them) so the images survive the round-trip:Environment
images: []rather thanundefined, so it no longer crashes (though images are still dropped).