Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
Seems to me that the drag/drop sorting does not work properly, as shown in attachment.
1) drag the first image, and swap with the second one.
2) save sorted results.
After saving, the first image becomes the last, which is incorrect.
Any ideas why?
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#5 | 1225152-sorting-fix.patch | 865 bytes | scroogie |
after_save.png | 78.71 KB | foredoc | |
before_save.png | 80.16 KB | foredoc | |
before_sort.png | 81.97 KB | foredoc |
Comments
Comment #1
justintime CreditAttribution: justintime commentedDamn - I was going to rant about the nightmare that is jquery, jquery_ui, and jquery_update, but then I duplicated the bug on two of my instances.
@foredoc - I was unable to duplicate the problem when I hit node/|NID|/sort/no_jquery - can you confirm the same?
@scroogie - you trolling? I'd love your jquery skills on this one.
Comment #2
foredoc CreditAttribution: foredoc commentedThanks. And I confirm that, by using node/|NID|/sort/no_jquery, there is no such problem.
Comment #3
dddave CreditAttribution: dddave commentedConfirmed. Odd that I didn't see this before. Might have been introduced lately.
Comment #4
scroogie CreditAttribution: scroogie commentedApparently this happens when the weights are not sequential and starting from 0 before you order the images (which can easily happen, so it was an oversight). See node_gallery.pages.inc lines 844-858. It wouldn't happen if we would update always every weight, but I guess thats also not really desirable. I'm not yet sure how I can avoid this, though.
Comment #5
scroogie CreditAttribution: scroogie commentedSo theoratically this should be the easy fix. If you can confirm (i've got problems reproducing the error), at least we know that we're talking about the same thing. Then we can think about a better way to fix it, if required.
Comment #6
dddave CreditAttribution: dddave commentedI am going to test this asap. Just for the record I noticed that the sort is completely broken. Instead of makeing the first pic second I put the second one and dragged it to the first spot-> Completely random outcome.
Comment #7
dddave CreditAttribution: dddave commentedDragged and dropped extensively and the issue seems to be fixed.
Comment #8
justintime CreditAttribution: justintime commentedI didn't test it, but reviewed the code. Now the jquery sort submit handler does the same thing as the no_jquery one, and that's how we did it back in 2.x.
While it may not be the cleanest approach, there's no functional problems with it. Instead of hashing out the best way to deal with it, I just committed @scroogie's patch into 3.x-dev. I'll wait until late today or early tomorrow and release beta3, since this is a fairly impactful issue.
Comment #9
foredoc CreditAttribution: foredoc commentedHi,
I downloaded a new Node Gallery 6.x-3.0-beta2, and applied the patch on it. However, the drag/drop sorting still does not work. Actually, it simply stick to the original order, no matter how I change them through drag/drop.
When I print out the $new_sort, and $original_sort, they are exactly the same.
Any ideas?
Thanks.
Comment #10
justintime CreditAttribution: justintime commentedIt's a local issue - the patch fixes http://dev.justintime.gotpantheon.com/ which was broken before the patch - you can test there if you like.
Try clearing your caches. If that doesn't work, it's likely a jquery mess, follow the docs @ http://ng3demo.sysadminsjourney.com/help/node_gallery/jquery-update to make sure things are correct.
Comment #11
foredoc CreditAttribution: foredoc commentedThanks. By disabling the jquery update module, the drag/drop sorting works.
Comment #13
thatjustin CreditAttribution: thatjustin commentedI had this issue. My symptoms were slightly different, I could sort and saving them worked without error, the order was just not ever changed. I had the jquery update module installed, and, following @justintime's and @foredoc's lead, I disabled the module, and all was better. But I needed the jQuery Update module for the plupload module. So, after some poking and prodding, following the instructions here:
http://drupalcode.org/project/jquery_ui.git/blob/refs/heads/6.x-1.x:/REA... on the jquery UI installation page for JQuery UI 1.7 did the trick.
I'm leaving this comment here for others.
Comment #14
justintime CreditAttribution: justintime commentedThanks for the notes. Just to add to it, we cover this a bit in the help within the module, you can see a copy of it here: http://ng3demo.sysadminsjourney.com/help/node_gallery/jquery-update