Automattic / Automattic/jetpack

Carousel: not working for some old format gallery blocks

Open
#27,199 4 comments 0 reactions 0 assignees View on GitHub
[Feature] Carousel [Plugin] Jetpack [Pri] Low Bug Customer Report [LEGACY]
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### Steps to Reproduce

- Run WordPress 5.8 and add a gallery block and save the post and load in the frontend
- Upgrade the site to WordPress 6 and install Jetpack plugin
- Under the Jetpack Writing settings toggle on the option to `Display images in a full-screen carousel gallery`
- Reload the gallery added in 5.8 in the frontend (it is important **not** to open this in editor and save after updating to 6) and notice that clicking on the image does not do anything
- Add a new post and add a gallery to it and load this gallery in the front end (which will be in a new format added in 5.9) and notice that clicking on the image loads the carousel as expected

### A clear and concise description of what you expected to happen.

The carousel images should load in both new and old gallery formats and functionality for this was [added and tested here](https://github.com/Automattic/jetpack/pull/21109).

Maybe some of the selectors have changed in a way that doesn't match with the old gallery format, eg. there was a [query change made here ](https://github.com/Automattic/jetpack/pull/26032) - that may be completely unrelated, but it may be a small change like this that has stopped it working with the old format.

The old gallery format structure is:

```html

```

### What actually happened

Image doesn't load in carousel for old gallery formats

### Browser

Google Chrome/Chromium

### Other information

_No response_

### Platform (Simple, Atomic, or both?)

Self-hosted

### Reproducibility

Consistent

### Severity

Some (< 50%)

### Available workarounds?

Yes, difficult to implement

### Workaround details

Work around requires a user to open the affected galleries and re-save them, which is a problem for users with hundreds of pages with galleries.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the supplied old gallery HTML and a new gallery, then compare the carousel work in PR 21109 with the query change in PR 26032. Trace which selectors match each gallery format and verify that clicking images opens the carousel for both formats without requiring the galleries to be re-saved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.