From d9bca9768cbf0d9779a69c044348e4ca8f047a57 Mon Sep 17 00:00:00 2001 From: Philip Schmidt Date: Tue, 1 Oct 2024 09:49:56 +0200 Subject: [PATCH 1/2] do not require a meta key --- Classes/Controller/DocumentsController.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/Classes/Controller/DocumentsController.php b/Classes/Controller/DocumentsController.php index 4b32869..8227665 100644 --- a/Classes/Controller/DocumentsController.php +++ b/Classes/Controller/DocumentsController.php @@ -304,9 +304,6 @@ public function queryAction(string $queryName, array $params = [], ?string $work if (!isset($result['data'])) { throw new Exception('Query result must contain a "data" key', 1715173500); } - if (!isset($result['meta'])) { - throw new Exception('Query result must contain a "meta" key', 1715173501); - } $this->view->assign('value', $result); } From 5210c70f31004501148df30456c82fe6476d18ff Mon Sep 17 00:00:00 2001 From: Philip Schmidt Date: Tue, 1 Oct 2024 09:50:41 +0200 Subject: [PATCH 2/2] add default values for item/itemKey/iterationName --- Classes/Fusion/Query/FlowQueryImplementation.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Classes/Fusion/Query/FlowQueryImplementation.php b/Classes/Fusion/Query/FlowQueryImplementation.php index 15996ea..ed34e84 100644 --- a/Classes/Fusion/Query/FlowQueryImplementation.php +++ b/Classes/Fusion/Query/FlowQueryImplementation.php @@ -26,17 +26,17 @@ protected function getItems(): mixed protected function getItemName(): ?string { - return $this->fusionValue('itemName'); + return $this->fusionValue('itemName') ?? 'item'; } protected function getItemKey(): ?string { - return $this->fusionValue('itemKey'); + return $this->fusionValue('itemKey') ?? 'itemKey'; } protected function getIterationName(): ?string { - return $this->fusionValue('iterationName'); + return $this->fusionValue('iterationName') ?? 'iterator'; } protected function getPage(): ?int