getkirby/toolkit — pull request #18 by gBokiau (2014-09-12 13:21:13+00:00)
Title: collection::sortBy falls back to filename sorting

Resort to sorting by filename amongst equal values or if no values were found.

This is especially useful when a blueprint specifies that files are sortable while they have no metadata (yet).

With this commit, sorting would then fall back to filename sorting whereas previously files would have ended up being sorted randomly.

As a desireable side effect, when two files have the same sorting value, they are sorted amongst themselves by filename, whereas previously they would have been sorted randomly.

(sidenote: I thought you had shared a solution somewhere for *actual* multi-sorting, but can't remember where nor how. But that's another matter)