Skip to content

Commit

Permalink
Fix #784 ordering in page collections
Browse files Browse the repository at this point in the history
Fixes accentuated characters ordering and also uppercase letters being
put first
  • Loading branch information
flaviocopes committed Apr 22, 2016
1 parent 385c076 commit fc5302f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/src/Grav/Common/Page/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -1029,10 +1029,10 @@ protected function buildSort($path, array $pages, $order_by = 'default', $manual
$list = $this->arrayShuffle($list);
} else {
// else just sort the list according to specified key
asort($list, $sort_flags);
$col = new \Collator(setlocale(LC_COLLATE, 0)); //`setlocale` with a 0 param returns the current locale set
$col->asort($list, $sort_flags);
}


// Move manually ordered items into the beginning of the list. Order of the unlisted items does not change.
if (is_array($manual) && !empty($manual)) {
$new_list = [];
Expand Down

0 comments on commit fc5302f

Please sign in to comment.