From bc1765fca1669a364abc906356b17423a4fa13dd Mon Sep 17 00:00:00 2001 From: Binal Gajjar Date: Mon, 25 Mar 2019 22:08:49 +0530 Subject: [PATCH] Issue fix #819 (#851) --- .../Database/TableGateway/RelationalTableGateway.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/Directus/Database/TableGateway/RelationalTableGateway.php b/src/core/Directus/Database/TableGateway/RelationalTableGateway.php index c47f3887b1..88d7236ddf 100644 --- a/src/core/Directus/Database/TableGateway/RelationalTableGateway.php +++ b/src/core/Directus/Database/TableGateway/RelationalTableGateway.php @@ -816,6 +816,11 @@ public function getItems(array $params = []) { ArrayUtils::remove($params, 'id'); + // Check if single param is set then convert it into boolean + if (ArrayUtils::get($params, 'single')) { + $params['single'] = json_decode(strtolower(ArrayUtils::get($params, 'single'))); + } + return $this->fetchData($params); } @@ -1109,7 +1114,7 @@ public function fetchItems(array $params = [], \Closure $queryCallback = null) $results = array_values($results); } - if (ArrayUtils::has($params, 'single')) { + if (ArrayUtils::get($params, 'single')) { $results = reset($results); }