From 74289fd67639e44201f751ad70f5234dfd9886dc Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 22 Nov 2024 14:52:39 +0100 Subject: [PATCH 1/2] fix: properly filter for content controls Signed-off-by: Julius Knorr --- lib/Service/TemplateFieldService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/TemplateFieldService.php b/lib/Service/TemplateFieldService.php index 5288ccf3ab..e743bf1603 100644 --- a/lib/Service/TemplateFieldService.php +++ b/lib/Service/TemplateFieldService.php @@ -78,7 +78,7 @@ public function extractFields(Node|int $file): array { $httpClient = $this->clientService->newClient(); $form = RemoteOptionsService::getDefaultOptions(); - $form['query'] = ['limit' => 'content-control']; + $form['query'] = ['filter' => 'contentcontrol']; $form['multipart'] = [[ 'name' => 'data', 'contents' => $file->getStorage()->fopen($file->getInternalPath(), 'r'), From f323d95c2e610f82ee3f503ec2cdef01ac1a591c Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Fri, 22 Nov 2024 14:53:08 +0100 Subject: [PATCH 2/2] fix: Catch unexpected results with no type Signed-off-by: Julius Knorr --- lib/Service/TemplateFieldService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/TemplateFieldService.php b/lib/Service/TemplateFieldService.php index e743bf1603..917a23a6fc 100644 --- a/lib/Service/TemplateFieldService.php +++ b/lib/Service/TemplateFieldService.php @@ -94,7 +94,7 @@ public function extractFields(Node|int $file): array { $fields = []; foreach ($documentStructure as $index => $attr) { - $fieldType = FieldType::tryFrom($attr['type']) ?? null; + $fieldType = FieldType::tryFrom($attr['type'] ?? '') ?? null; if ($fieldType === null) { continue; }