Has something changed in the Sort order since the 1.4.5.7 update?
My sort no longer seems to work.
Under Options>Image I have "Sort Images By" set to Custom, and my custom fields set to date,filename
This has always displayed my new images first in the albums, but since the last update images seem to appear in random order.
Comments
Case:
I do have images in manual order like: A,B,C
When i do upload new images (1,2,3) i would expect the new order to be: A,B,C,1,2,3
In fact the new order looks like this 1,A,2,B,3,C
Changes on the admin->options-> page doe's not affect my image sort order in the album at all (i tried every possible value, even sort by db field 'sort_order,date') . The order in the album is set to "manually".
I did an update to 1.4.5.9. but it did not solve the problem.
Inside the database the "sort_order" field for the new images (1,2,3) ist set to "NULL".
Help appreciated :-)
Sorting by filename was correct 1, 2, 3, a, b, c but by title it was 2, 3, a, b, c, 1. Both on 1.4.5.9 support build and 1.4.6.
So something seems wrong. Best open a ticket.
Also please describe exactly how you have set things. For instance, if by "admin->options->page" you mean the global sort order it can be overridden by sort order of a particular album.
If there is no "sort_order" value stored for the images, new images are put in order behind the older images.
Options->Images->Order is set to: custom(sort_order,date) (but no changes do occur, whatever i choose here!. Albums sort order is "manually".
I did update the site from 1.4.4. to 1.4.5.8 (then to 1.4.5.9)
Let me know if you do need any further information.
Thank you for your help!
This strange behaviour occured on a live website with a big image database and in every folder were images have been uploaded after i did the update to 1.4.5.8 the manual sort order is now incorrect. This is causing me a lot of trouble, so any help is really appreciated.
Thank you for your patience!
As I could reproduce it on both installs there must be some detail that is going wrong. But that will require more testing. I haven't looked into the database for example. Still interesting that it works with ordering filename but not titles. Especially as they are the same in my case.
"getImages(NULL,NULL,'sort_order,id')" and did the same on all my template parts where "next_image()" occurs. Now it works as it should.
I know editing core files is not recommended. But i guess that within the next update the problem will be fixed, so that i can easily replace the core file with the original one.
So if anyone is experiencing the same problem, this might be a solution for now.
Thanks for your support!
Are you sorting by ID as above or by filename as first stated?
The code you put in `admin-albumsort.php` will have no impact on anything (except the order of that display) unless you save the sort. Then the sort will be "manual". If the sort is manual new images do indeed go at the end. They have to go somewhere and that seemed reasonable.
You should read the release notes for the next release. Placing the sort order in the `next_image()` loop is deprecated (and often does not work anyway) because any "fetch" if images prior to the loop probably will be in a different order. So such things as pagination will fail.
You can set the album object sort order at the start of your script with object methods. This is available in the 1.4.5.9 release already. If this is done before any other reference to the images then all is consistent.