Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

More Block: Gallery display broken on archive pages when more block is added #58618

Open jerrysarcastic opened 2 years ago

jerrysarcastic commented 2 years ago

Quick summary

When the More Block is added to a post which has a gallery block present, the gallery is presented correctly on the post page, but on archive pages (anywhere the loop is output) the gallery display is broken and images are shown in a single column without a carousel option.

The gallery is shown correctly on the single post directly, it is only when displayed on an archive page that the gallery functionality is stripped out. Issue can be seen in the following video: https://d.pr/v/ZB605V

Chapters 0:00 - 0:12 homepage shown with normal gallery display in most recent post 0:13- 0:29 post is edited to add more block 0:30 - 0:40 single post is shown with gallery and carousel working as expected 0:40 - 1:00 post is shown on homepage (set as posts page) where gallery is shown as single images without carousel 1:00 - end - More block is removed, restoring gallery appearance/function on homepage.

Steps to reproduce

  1. create test post with gallery block and more block (entered after the gallery)
  2. Publish test post
  3. Visit post directly, gallery should display/function as normal
  4. Visit homepage (or any archive page) and see gallery is broken and has no carousel function

What you expected to happen

Gallery to function as normal on archive pages

What actually happened

Gallery displays as single images without carousel functionality

Context

Customer report + self-testing

Reported in https://wordpress.com/forums/topic/issues-with-new-gallery-block/

Operating System

macOS

Browser

Google Chrome/Chromium

Simple, Atomic or both?

Simple

Theme-specific issue?

Seems to not be theme-specific, I have tested and reproduced in the following themes:

Other notes

No response

Reproducibility

Consistent

Severity

No response

Available workarounds?

No response

Workaround details

Only workaround is to remove the More Block, or ensure that gallery content is added after the more block, so it is excluded from archive pages.

Robertght commented 2 years ago

Thank you for reporting this @jerrysarcastic!

@glendaviesnz is this something that can be looked into by the team that is working on the gallery block?

glendaviesnz commented 2 years ago

This is caused by a known incompatibility with the new Gallery block and the WP core use_balanceTags option.

We thought this only affected sites that had turned the deprecated use_balanceTags option on, but it turns out that the when more option is added to a post it forces the truncated content through the force_balance_tags option regardless of the use_balanceTags option setting.

This is fixed in WP 5.9, but that is not due out until End of January. I will see if there as any other workaround for this in the mean time.

glendaviesnz commented 2 years ago

@jerrysarcastic this issue should be fixed now on WPcom simple sites.