Further update: It is indeed the Collator class sorting causing this. While it fixes the original issue of words not being sorting, it fails whenever a date is included. And it does this rather unpredictable which is why we didn't notice it first. We're thinking about how to workaround here,. WE could make an exception for sorting by daate btu then filenames with dates will still fail. So prrobably we will end up with a bunch of new options…
Yes, of course that is the standard loop on a standard theme. But that's end of the line, The logic of fetching and sorting happens deeper in core.
next_image uses:
getImages() (if we stay with normal album context)`sortImageArray()sortByKey() sortArray() which features the collator class change I am talking about and which I could reprodue the issue with.. For title and description it uses the function sortMultingualArray() which also uses sortArray().So we need an option respectively options so users can choose which "natural order" they want. Wht works for filenames with dates does not work for say French languagle titles. Again we added this to fix a sorting bug. But becuase of the strange behaviour we missed that it breaks sorting by date. We had test array where all dates were correcty, just some were not without any visible reason.
Or we make a coded exception only for date sorting. But then filenames with a date will still not work properly
Blame it on PHP that offers standard natural order that is not language aware and then introduces an extra class which also does not work completely as expected.
FYI the array comparison of the issue:
https://www.zenphoto.org/test/collator-vs-natcasesort-datesorting.jpg.html
Sorry, a bit slow in replying. I checked phpinfo and Intl is enabled, but it looks as though you've discovered the source of the issue (I'm trying to follow but php programming is like speaking in swahili to me).
Is it possible to downgrade a 1.5.8 ro 1.5.7 pending extermination of this bug?
While I don't tink we have database changes but I would not recommed it as there are lots of other fixes everywhere.
The hot fix solution is note above to remove the Collator class. There might be afix in 1.5.9a soon, respectively options that are off by default to restore the previous default.
Seems we found a better fix than introducing new options by setting a missed parameter.
So please try the 1.5.9a on GitHub to see if it does for you. In this rare case it might work to just copy the functions.php (or even the sortArray() function itself) as there are not many changes from 1.5.8 yet.
Thanks, acrylian, likewise copied functions.php and installed it - much appreciated that date sorting is fixed and so far albums look back to normal.
Zenphoto-admin is now telling me that I've changed functions.php and I should run setup. If I do will it revert to older functions.php? (sorry for newb question)
Running setup does no revert anything. The notice is just a mild security notice in case some may got in somehow and might have hacked the file. It just checks the filetime in relation to all other files currently. In this case you know you were it.
Thanks for the feedback that the issue is fixed.