Pages (2):    1 2
Administrator
Administrator
acrylian   2021-06-25, 12:56
#21

We might have found something indeed. It might be that while the "real natural order" is way better with real text but has problems with dates indeed. But we need to run some more tests to be sure about that.

Administrator
Administrator
acrylian   2021-06-25, 16:07
#22

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…

Member
Member
mkanoute   2021-06-25, 16:49
#23

No. The logic that prints images is like this:
while (next_image()):
// print images here
endwhile;

next_image() returns the images in a randon order as decribed before.

Administrator
Administrator
acrylian   2021-06-25, 19:33
#24

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:

  • the album class methid getImages() (if we stay with normal album context)`
  • which uses the album class method sortImageArray()
  • which uses the functions.php function sortByKey()
  • which - surprise - uses the functions.php function 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

Member
Member
steam4m   2021-06-26, 01:55
#25

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?

Administrator
Administrator
acrylian   2021-06-26, 07:12
#26

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.

Administrator
Administrator
acrylian   2021-06-26, 12:38
#27

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.

Member
Member
mkanoute   2021-06-26, 13:05
#28

I copied functions.php from master on Gitthub and it looks good so far. Thank you!
I'm happy to not have make you lost your time.

Administrator
Administrator
acrylian   2021-06-26, 13:41
#29

Thanks for the feedback and being persistent that there was an issue.

Member
Member
steam4m   2021-06-27, 08:47
#30

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)

Administrator
Administrator
acrylian   2021-06-27, 11:03
#31

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.

Pages (2):    1 2
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.