I just noticed a problem with the Aug 9 dev snapshot and I'm not sure if it existed prior.
I've noticed when browsing a few albums that the navigation through individual images would break. By break I mean:
Current displaying item #4. Click next. Picture for item #5 is displayed but item #4 is highlighted in the pager and can't advance any further via next.
I figured out this occurs when two images have the same value for whatever sort criteria is being used (e.g. chronological or alphabetical)
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | acidfree.module.patch | 1.64 KB | bkat |
Comments
Comment #1
vhmauery commentedThanks for finding the root cause. I think this is actually a duplicate of another bug, but this bug put it much more clearly. I was able to reproduce it and immediately fix the issue.
I have committed the fix to CVS.
Comment #2
bkat commentedDid this make it into the Aug 15 dev snapshot?
I've installed that version and am seeing some funny behavior in this album:
http://womensfooty.com/album/hotties/western_region
When the album is sorted alphabetically, the pager is all messed up. I click on the first picture and it displays but #2 is highlighted. "Next" brings me to #4 then #6 and finally 7,8,9 are ok.
Is this a new bug or the same thing?
Comment #3
vhmauery commentedoops. Looks like I didn't test it enough. It seemed to work great for me... More albums! More photos!
Comment #4
skizzo commentedNot sure if this is the same bug. AF 5.x-1.x-dev Aug 15. Switched mode from Alphabetical to Latest Post First, then back to Alphabetical. All 14 elements are now displayed with correct order in album page, but navigation is now broken: stepping through images, 11 elements only are displayed (with following element number sequence: 6, 4, 8, 10, 12, 5, 3, 7, 9, 11, 13). Clicking on #8 brings up img #9. Some "previous" links do not work.
Comment #5
bkat commentedI just did a little bit of investigating on this issue and have some progress to report.
I have an album that is sorted by title. I've found two cases that break the pager navigation:
1. If a title has a single quote in it ("Who's da man?"), this causes the node query in _acidfree_get_offset_in_parent() to include the node being checked in the query result. I worked around this by adding "and n.nid != %d" to the query string and passing $node->nid as a query parameter.
2. Titles that start with a lower case letter. It looks like acidfree is somehow doing some queries with a case insensitive comparison on the title and others case insensitive. The last three titles in my album are
"Who's da man? Timmy!", "x3 Baby!" and "Yay Cathy!". The pager wants to set them up in that order. However when _acidfree_get_offset_parent() is executed it includes this term in rhe order by :
CONCAT(rpad(n.title, 32, ' '), LPAD(n.nid, 10, '0')) < 'x3 BABY! 0000001362';
and that includes "YAY Cathy! ...." in its results.
This seems to be caused by some weird type issues in mysql
select 'x1362' < concat('Y', 1363)
vs
select 'x1362' < concat('Y', cast(1363 as char))
In _acidfree_filter_clause i added the cast to the last clause for 'nid' and my album seems to be sorting correctly now. I realize that my fix isn't correct as the cast syntax is a mysql extension to standard SQL (i think).
EDIT: the mysql documentation http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_cast says that CAST() is standard SQL so maybe my workaround isn't so bad.
Comment #6
xav commentedHi,
I have the problem with this album: http://parateam.com/album/photos-dilan
As acidfree releases seem far apart, could someone please send a patch ?
Thanks,
Xav
Comment #7
bkat commentedHere's a patch for the changes I've made. Still needed on the development snapshort released on 2008-02-11
Comment #8
xav commentedThanks a lot, it works like a charm with that !
Xav
Comment #9
vhmauery commentedApplied to CVS. Thanks for your help.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.