Posted by djs_core on November 5, 2010 at 12:46pm
12 followers
Jump to:
| Project: | Gallery Assist |
| Version: | 6.x-1.19-beta5 |
| Component: | User interface |
| Category: | task |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hi,
in the new version is global default set of sorting photos to descending. If I change the settings to ascending and save, settings are not saved, restore descending (btw in the node setting is it functional).
Comments
#1
Hello djs_core,
I have commited the fix to the dev. In case you want better use a patch, here the link to them.
Regards and thanks
Juan Carlos
#2
Hi,
change items order (numerically or per drag) has no effect! Also has no effect changing sort order (asc / desc).
The numeric value of the item order can be save without effect to the image order of the gallery.
GA 6.x-1.18 // GAL 6.x-1.4 // GAic 6.x-1.2 || D 6.19
#3
Hello,
me too I'm having this problem. I'm not sure when it started, maybe while I was trying to figure out how to make "public to all" back again all my galleries. I overridden severla options, then reverted.
Also manually changing values on db, doesn't help. Those values are ok, after all. So where the error comes from?
#4
I found the problem. This is the query with the wrong "ORDER BY" statement:
SELECT a.pid, a.nid, a.ref, a.gid, a.gref, a.sid, a.uid, a.fid, a.filename, a.opath, a.ppath, a.tpath, a.copyright, a.weight, a.cover, a.aid, f.timestamp, tp.lang, tp.ptitle, tp.palt, tp.pdescription, tp.format, tp.did FROM gallery_assist_item a JOIN gallery_assist_translated tp ON a.pid = tp.pid JOIN files f ON f.fid = a.fid WHERE a.gref=28 AND tp.lang = 'it' ORDER BY a.cover DESC, a.weight ASCI changed
gallery_assist.module:1845
$query .= " ORDER BY a.cover DESC, {$ga_db_order_field} {$ga_db_order}";to
$query .= " ORDER BY {$ga_db_order_field} {$ga_db_order}";I suppose "a.cover" is an album cover, but I have no albums. I have galleries assigned to nodes, so I have no covers.
I don't know if my modification would break standalone galleries.
Greetings,
-Ermanno
#5
Hello
"a" is an alias from table "gallery_assist_item". a.cover is the boolean value which that flag a image as cover.
If you remove a.cover, the cover images in your galleries will are not more the first image in the image order.
I am sure this Problem is in other place and I will solve it in the next time so far I can.
Regards
Juan Carlos
#6
Hi jcmc,
thanks for your reply.
I found that problem after I upgraded from 1.15 to 1.18.
In 1.15 that query is different (see ORDER BY at gallery_assist.module:1661):
$query = "SELECT a.pid, a.nid, a.ref, a.gid, a.gref, a.sid, a.uid, a.fid, a.filename, a.opath,a.ppath, a.tpath, a.copyright, a.weight, a.cover, f.timestamp, tp.lang, tp.ptitle, tp.palt, tp.pdescription, tp.format,
tp.did FROM {gallery_assist_item} a JOIN {gallery_assist_translated} tp ON a.pid = tp.pid
JOIN {files} f ON f.fid = a.fid
WHERE a.gref=%d AND tp.lang = '%s'";
$query .= " ORDER BY ". $udata['ga_db_order_field'];
$query .= " ". $udata['ga_db_order'];
#7
Same problem here. Even only upgrading to 1.18 changed my existing galleries photos' order and they can no longer be resaved in the correct order :-(
#8
Having this issue too, 1.18.
#9
Hi Juan Carlos,
the bug is still on in the dev version from Nov 27th :-(
Would be great if you find it. Thx!
Greetings, 4ud
#10
and is also in the version: gallery_assist-6.x-1.19-beta2
4ud
#11
#12
Any news regarding the items order problem? I also have that issue (on 1.18) and would be great if it could be solved!!
#13
+1
Is this being addressed in the upcoming 1.19?
#14
same issue, can not reorder photos. I've updated to 6.x-1.19beta5 and still have the same issue.
#15
The weird thing is that this has already been working but then was broken again. I guess this should be easy to fix.
#16
I could not find where to fix this in gallery_assist.module so I made this change to the display templates :
In the gallery_assist_display function (top of the file), right after :
if (count($node->gallitems) == 0) {return;
}
I added a sort on the gallery items array :
usort($node->gallitems, function($a, $b) {$wa = $a->weight;
$wb = $b->weight;
if ($wa == $wb) {
return 0;
}
return ($wa < $wb)? -1 : 1;
});
This is definitely not the best place to have a data sort but it did the trick for me pending a bug fix.
#17
My previous code generates a parse error with PHP < 5.3. To fix that, move the sort function outside gallery_assist_display ; i.e. place this code before function gallery_assist_display :
/*** Helper function, for sorting gallery items array by weight.
* See http://drupal.org/node/963238
*/
function gallery_assist_display_sort_items($a, $b) {
$wa = $a->weight;
$wb = $b->weight;
if ($wa == $wb) {
return 0;
}
return ($wa < $wb)? -1 : 1;
}
and the code inside gallery_assist_display becomes :
usort($node->gallitems, gallery_assist_display_sort_items);#18
Is it possible to fix this issue?
#19
Please what is the recommended fix for this cumbersome problem?If you have a gallery node with images distributed over more than one pages, the ascending file name ordering does not work properly. The first item is wrong.
Is this module still maintained?
#20
Having the same issue. Changing the weight of images does not seem to do anything. Ideally it would be awesome if you could include drop and drag functionality and order the images in that way. Well if anyone has found a solution please post!
#21
That has already worked in a past version, so the solution should be known. The problem exists both in 6.x-1.18 and 6.x-1.19-beta5, so please keep the affected version on the latest one.
#22
The fix submitted by nicolascuny works fine for the grid view but the pager links in the item view still bring up the wrong picture. Judging by the duration of this issue I'm guessing this won't get fixed. Too bad, I had hoped to use this module.
#23
The module author recently showed some activity in Git (for a D7 version), after being silence for many months. So there is a hope he will look at this issue some day and fix it...