From 340bd38b1be3e627fece723497748357ad28f3b9 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Tue, 12 Nov 2024 16:28:27 +0000 Subject: [PATCH 1/2] [5.x] Allow transformResults to be called separately from getBaseItems (#11115) --- src/Search/QueryBuilder.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Search/QueryBuilder.php b/src/Search/QueryBuilder.php index f2f09492df..fc01ad19f6 100644 --- a/src/Search/QueryBuilder.php +++ b/src/Search/QueryBuilder.php @@ -52,6 +52,11 @@ public function getBaseItems() { $results = $this->getSearchResults($this->query); + return $this->transformResults($results); + } + + public function transformResults($results) + { if (! $this->withData) { return $this->collect($results) ->map(fn ($result) => new PlainResult($result)) From 0d2403d69d467055e649815841ce401a4c2a210d Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Tue, 12 Nov 2024 16:29:39 +0000 Subject: [PATCH 2/2] [5.x] Prevent duplicate nocache regions in session (#11109) --- src/StaticCaching/NoCache/Session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StaticCaching/NoCache/Session.php b/src/StaticCaching/NoCache/Session.php index 27c2b16466..1b6bce0f3e 100644 --- a/src/StaticCaching/NoCache/Session.php +++ b/src/StaticCaching/NoCache/Session.php @@ -123,7 +123,7 @@ public function restore() { $session = StaticCache::cacheStore()->get('nocache::session.'.md5($this->url)); - $this->regions = $this->regions->merge($session['regions'] ?? []); + $this->regions = $this->regions->merge($session['regions'] ?? [])->unique()->values(); $this->cascade = $this->restoreCascade(); $this->resolvePageAndPathForPagination();