Skip to content

Gallery card editor allows adding more than 9 images #22054

@brandishwar

Description

@brandishwar

Issue Summary

Per my comment on the forum:

Bumping this so everyone else who come across this will see this doesn’t work as expected. Since, sure, you can add more than 9 images to a gallery using that technique. But Ghost will only display the first 9 images when viewing that post.

I just tested this with v5.107.2, combining two adjacent galleries by dragging the images from one into another, creating a gallery with 16 images. But when viewing the post, the gallery card only displayed the first 9.

And it gets worse: going back into the post editor, the gallery card in the editor again showed only the first 9. All the other images were lost.

The underlying issue here is the Gallery card editor allows you to add more than 9 images by dragging additional images into the gallery card. Current the editor only stops you from adding 9 if you're dragging/dropping or using the file selector. It should also stop you from dragging more than 9 images into the gallery card.

Steps to Reproduce

  1. Start a new post
  2. Create two galleries, identify as "Gallery1" and "Gallery2". Gallery1 has less than 9 images, but the total images between both galleries is more 10 or more.
  3. Drag all images from Gallery2 into Gallery1 such that you have more than 9 images in Gallery1.

Actual behavior: No error is displayed. Editor allows you to add 10th image.
Expected behavior: Error is displayed. Editor does not allow you to add 10th image to the gallery and the drag/drop is aborted.

  1. Delete Gallery2 after all images are dragged into Gallery1.
  2. Publish the post. No error is displayed about having a gallery with more than 9 images.
  3. View the post. Only 9 images are displayed in Gallery1. None of the additional images are displayed.
  4. Re-open the post for editing. Only 9 images are displayed in the gallery card. All other images that were dragged in are lost.

Ghost Version

5.107.2

Node.js Version

20.18.1

How did you install Ghost?

Self hosted on Linux Mint

Database type

MySQL 8

Browser & OS version

No response

Relevant log / error output

Code of Conduct

  • I agree to be friendly and polite to people in this repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects:editorWork relating to the Koenig Editorbug[triage] something behaving unexpectedlystale[triage] Issues that were closed to to lack of traction

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions