From bffa632a8fc830c614effccd312773cce57116af Mon Sep 17 00:00:00 2001 From: Awilum Date: Wed, 19 Dec 2018 20:09:41 +0300 Subject: [PATCH] Content: Issue - Return value of Flextype\Component\Arr\Arr::sort() must be of the type array, none returned - fixed --- flextype/Content.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/flextype/Content.php b/flextype/Content.php index 1f81bfe1..fb122371 100755 --- a/flextype/Content.php +++ b/flextype/Content.php @@ -293,11 +293,13 @@ class Content } // Sort and Slice pages if $raw === false - if (!$raw) { - $pages = Arr::sort($pages, $order_by, $order_type); + if (count($pages) > 0) { + if (!$raw) { + $pages = Arr::sort($pages, $order_by, $order_type); - if ($offset !== null && $length !== null) { - $pages = array_slice($pages, $offset, $length); + if ($offset !== null && $length !== null) { + $pages = array_slice($pages, $offset, $length); + } } }