WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 6 months ago

#34390 new defect (bug)

Gallery - images order

Reported by: Stagger Lee Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.3.1
Component: Gallery Keywords: needs-patch
Focuses: Cc:
PR Number:

Description

I already asked here, but nobody answered:
https://wordpress.org/support/topic/media-manager-shuffle-images-all-the-time?replies=10

Seems as it is a bug, or oversight because you maybe dont test this real life scenario case. I know now what triggers this problem, did not know when asked in this topic.

Some short info:

  • Have this problem in 1-2 years.
  • Installed new and clean Wordpress (to exclude my code lines or plugins)
  • Default theme, no plugins, no custom code in functions.php, no custom code in wp-config.php, .htaccess.

How to trigger problem:

  • Add new post.
  • Open media manager and insert many images (In my case was it 280 images uploaded at once. I make multiple galleries on separate subpages to reduce page load). But for your test you can have maybe 100 images uploaded in this post, not so important.
  • When uploading finished you will see that all images are sorted in perfect order.
  • Just for clean test close modal box and open it again Add Media and chose Create Gallery.
  • Images are still sorted in perfect order.
  • Go to the first image media manager uploded in this batch. In my case as it was clean installation it was image first at the bottom (but you get it).
  • Now comes part how you trigger glitch/bug.
  • If you mark first uploaded image and hold Shift arrow on keyboard, and if you CLICK ONLY ONCE at last image you want in your gallery, sorting in gallery (backend and frontend) is still perfect and OK.
  • But, if you hold Shift key and keep clicking on row after row (to be able to see number of images in gallery at the bottom bar "#No selected"), then problems comes and seems as JS code is confused and shuffle many images.
  • Problem will be visible in next modal window where you chose gallery settings, in post self and on the front.

Shift and click on last image wished in gallery = perfect order.
Shift and click several time around before you decide what to mark = shuffled images.

http://s7.postimg.org/4o50g6cpn/2015_10_21_184256.jpg
http://s17.postimg.org/t0c4blrin/2015_10_21_184859.jpg
http://s9.postimg.org/4msb88s9r/2015_10_21_185039.jpg

Change History (6)

#1 @antpb
4 years ago

  • Keywords reporter-feedback 2nd-opinion added

Thanks for the detailed steps. I followed them exactly but was unable to reproduce. Do you suspect that this is an issue due to the amount of images uploaded? I tested with 30 images fresh upload straight from the create gallery modal. I clicked the first image, then the first image from the last row. I then clicked an image above it.

I tested a second time but after selecting the first image in the last row I selected the last image in that row. I even went crazy clicking around random images but everything output as expected.

#2 @Stagger Lee
4 years ago

I believe it is needed to have as much images as it is needed to get rows "owerflow", outside visible view. Depends of monitor screen, sometimes even 50 images are enough. Not sure in it at all, just saying.

I will make now new screenshots with numbers and mouse clicks order. Easy to understand.

#3 @Stagger Lee
4 years ago

Maybe it is important to release Shift key at least once to get this problem. If you dont release Shift key you cannot scroll outside visible screen area, and cannot mark other images.

Problem is I dont know what to do anymore. WordPress installation is 100% clean and default. And I am not WordPress beginner. I am lost simply.

http://s3.postimg.org/fo6xljxoz/2015_10_21_233821.jpg

You can see by shortcode it suffle images (IDs).

[gallery ids="288,304,303,302,301,300,299,298,297,296,295,294,293,292,291,290,289,313,312,311,310,309,308,307,306,305,322,321,320,319,318,317,316,315,314,331,330,329,328,327,326,325,324,323"]
Last edited 4 years ago by Stagger Lee (previous) (diff)

#4 @antpb
4 years ago

  • Keywords needs-patch added; reporter-feedback 2nd-opinion removed
  • Milestone changed from Awaiting Review to Future Release

There we go! It seems that it will throw them off based on the order you click them going from the bottom up. I was able to reproduce without uploading a large amount of images. It seems to only happen when you go bottom up selecting images row by row holding the shift key. Really odd. My initial thoughts is that it has something to do with how the shortcode is output but I'll have to look into it more.

I don't know if I or anyone else will get this fixed before 4.4 so I'll mark this as future release and keep an eye on it.

Thanks for the clarification!

#5 @Stagger Lee
4 years ago

Yes @antpb, exactly.

I have to go from the bottom up because of the time order. It is about many images from one party / event and people visiting gallery/galleries excpect this order. It they were there on party it is only natural way to represent event in gallery/galleries.

Version 0, edited 4 years ago by Stagger Lee (next)

#6 @Stagger Lee
4 years ago

One interesting thing more. When going from bottom up. Even if I dont click several times on rows and go directly to last image to mark, it shuffle my first image only.
First marked image end as last image i gallery, (on oposite side).

Only one image, first marked.

Note: See TracTickets for help on using tickets.