From b88aac2bf492356a98de7fa8d27813e25b2aec67 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Fri, 17 Dec 2021 12:34:22 +0100 Subject: [PATCH] Explicitly pass language `*` is none is given --- CHANGELOG.md | 6 ++++++ src/Api/PrismicApi.php | 14 +++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b442ffd..94fbda0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +4.0.0-beta.8 +============ + +* (bug) Explicitly pass language `*` is none is given. + + 4.0.0-beta.7 ============ diff --git a/src/Api/PrismicApi.php b/src/Api/PrismicApi.php index bff35f8..bdfe7e9 100644 --- a/src/Api/PrismicApi.php +++ b/src/Api/PrismicApi.php @@ -77,19 +77,15 @@ public function searchDocuments ( while ($page <= $maxPage) { - $query = [ + $response = $this->requestContent("documents/search", [ "ref" => $ref ?? $this->getEnvironment()->getMasterRefId(), "q" => \implode("", $predicates), "pageSize" => 100, "page" => $page, - ]; - - if (null !== $language) - { - $query["lang"] = $language; - } - - $response = $this->requestContent("documents/search", $query); + "lang" => null !== $language + ? $language + : "*", + ]); foreach ($response["results"] as $result) {