From 300f65c22e22cd7c8dc425347ec600bdbd560ee0 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Fri, 20 Jan 2017 15:17:28 -0700 Subject: [PATCH] Implode an array returned by sort order #1264 --- CHANGELOG.md | 10 +++++++++- system/src/Grav/Common/Page/Pages.php | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65376376d..7397b7461 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,16 @@ +# v1.1.15 +## xx/xx/2017 + +1. [](#new) + * Added a new `Collection::merge()` method to allow merging of multiple collections [#1258](https://github.com/getgrav/grav/pull/1258) +1. [](#bugfix) + * Fixed an issue when page collection with header-based `sort.by` returns an array [#1264](https://github.com/getgrav/grav/issues/1264) + # v1.1.14 ## 01/18/2017 1. [](#bugfix) - * Fixed `page.collection()` returning array and not Collection object when header variable did not exist + * Fixed `Page::collection()` returning array and not Collection object when header variable did not exist * Revert `Content-Encoding: identity` fix, and let you set `cache: allow_webserver_gzip:` option to switch to `identity` [#548](https://github.com/getgrav/grav/issues/548) # v1.1.13 diff --git a/system/src/Grav/Common/Page/Pages.php b/system/src/Grav/Common/Page/Pages.php index 43e9a388e..6f960880d 100644 --- a/system/src/Grav/Common/Page/Pages.php +++ b/system/src/Grav/Common/Page/Pages.php @@ -1079,7 +1079,9 @@ protected function buildSort($path, array $pages, $order_by = 'default', $manual case (is_string($header_query[0])): $child_header = new Header((array)$child->header()); $header_value = $child_header->get($header_query[0]); - if ($header_value) { + if (is_array($header_value)) { + $list[$key] = implode(',',$header_value); + } elseif ($header_value) { $list[$key] = $header_value; } else { $list[$key] = $header_default ?: $key;