From cdf9240e64f460cf5bb6d1922bdf191068f158e8 Mon Sep 17 00:00:00 2001 From: Wilco Louwerse Date: Tue, 2 Jul 2024 12:16:56 +0200 Subject: [PATCH 1/3] We no longer need to give $search parameter to searchobjects --- src/Service/SitemapService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Service/SitemapService.php b/src/Service/SitemapService.php index d6f5e9d..4832adb 100644 --- a/src/Service/SitemapService.php +++ b/src/Service/SitemapService.php @@ -221,7 +221,7 @@ private function getSitemap(array $parameters): array ); $publisherSchema = $this->resourceService->getSchema('https://commongateway.nl/woo.sitemap.schema.json', 'common-gateway/woo-bundle'); - $publishers = $this->cacheService->searchObjects(null, ['oin' => $parameters['oin']], [$publisherSchema->getId()->toString()])['results']; + $publishers = $this->cacheService->searchObjects(['oin' => $parameters['oin']], [$publisherSchema->getId()->toString()])['results']; if (count($publishers) === 0) { $this->logger->error('Couldn\'t find a publisher for this oin: '.$parameters['oin'], ['plugin' => 'common-gateway/woo-bundle']); @@ -233,7 +233,7 @@ private function getSitemap(array $parameters): array // $filter = ['_limit' => 50000]; // Get all the publication objects with the given query. - $objects = $this->cacheService->searchObjects(null, $filter, [$publicatieSchema->getId()->toString()])['results']; + $objects = $this->cacheService->searchObjects($filter, [$publicatieSchema->getId()->toString()])['results']; $sitemap = []; foreach ($objects as $object) { @@ -341,7 +341,7 @@ private function getRobot(array $parameters): array $host = $this->requestStack->getMainRequest()->getHost(); - $sitemaps = $this->cacheService->searchObjects(null, ['domains' => $host], [$sitemapSchema->getId()->toString()]); + $sitemaps = $this->cacheService->searchObjects(['domains' => $host], [$sitemapSchema->getId()->toString()]); if (count($sitemaps['results']) === 1) { $oin = $sitemaps['results'][0]['oin']; From 6cf3f32189805b68dbdf1775f4fbed10a09655f5 Mon Sep 17 00:00:00 2001 From: Wilco Louwerse Date: Tue, 2 Jul 2024 12:34:25 +0200 Subject: [PATCH 2/3] We need CoreBundle 1.4.13 or higher for this --- composer.json | 2 +- publiccode.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index d5a5e31..d8ae4ee 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "minimum-stability": "dev", "require": { "php": ">=8.2", - "commongateway/corebundle": "^1.3.18 | <2.0", + "commongateway/corebundle": "^1.4.13 | <2.0", "smalot/pdfparser": "^2.8" }, "require-dev": { diff --git a/publiccode.yaml b/publiccode.yaml index 9ac5ef1..30b2b60 100644 --- a/publiccode.yaml +++ b/publiccode.yaml @@ -86,14 +86,14 @@ nl: dependsOn: open: - name: CommonGateway - versionMin: 1.3 - versionMax: 2.0 - version: 1.3.18 + versionMin: 1.4 + versionMax: 1.5 + version: 1.4.13 optional: false - name: CoreBundle - versionMin: 1.3 - versionMax: 2.0 - version: 1.3.18 + versionMin: 1.4 + versionMax: 1.5 + version: 1.4.13 optional: false roadmap: null inputTypes: From 08ab4c6e49b5b5139eaaef3fb4e937442a8a20bf Mon Sep 17 00:00:00 2001 From: Wilco Louwerse Date: Tue, 2 Jul 2024 12:36:59 +0200 Subject: [PATCH 3/3] And also update CountObject --- src/Service/SitemapService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Service/SitemapService.php b/src/Service/SitemapService.php index 4832adb..79a991a 100644 --- a/src/Service/SitemapService.php +++ b/src/Service/SitemapService.php @@ -299,7 +299,7 @@ private function getSitemapindex(array $parameters): array } // Count all the publication objects with the given query. - $count = $this->cacheService->countObjects(null, $filter, [$publicatieSchema->getId()->toString()]); + $count = $this->cacheService->countObjects($filter, [$publicatieSchema->getId()->toString()]); $pages = ((int) (($count - 1) / 50000) + 1); // Get the domain of the request.