Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gallery card editor allows adding more than 9 images #22054

Open
1 task done
brandishwar opened this issue Jan 26, 2025 · 1 comment
Open
1 task done

Gallery card editor allows adding more than 9 images #22054

brandishwar opened this issue Jan 26, 2025 · 1 comment

Comments

@brandishwar
Copy link

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
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Jan 26, 2025
@9larsons
Copy link
Contributor

Hey, thanks for the report! I've been able to reproduce. Fwiw, the Preview button does show the 9 but I agree we ought to add some validation into the editor to not catch anyone off guard.

@9larsons 9larsons removed the needs:triage [triage] this needs to be triaged by the Ghost team label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants