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); }