mirror of
https://github.com/getgrav/grav.git
synced 2026-05-09 00:37:13 +02:00
Fix warnings when sorting empty collection of pages
This commit is contained in:
@@ -173,6 +173,9 @@ class Pages
|
||||
public function sortCollection(Collection $collection, $orderBy, $orderDir = 'asc', $orderManual = null)
|
||||
{
|
||||
$items = $collection->toArray();
|
||||
if (!$items) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$lookup = md5(json_encode($items));
|
||||
if (!isset($this->sort[$lookup][$orderBy])) {
|
||||
|
||||
Reference in New Issue
Block a user