Skip to content

Commit

Permalink
fix: Adapt pdf service to new field api
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliushaertl committed Aug 28, 2024
1 parent fe8a363 commit 9d42fc3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/Service/PdfService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

use mikehaertl\pdftk\Pdf;
use OCP\Files\Node;
use OCP\Files\Template\Field;
use OCP\Files\Template\FieldFactory;
use OCP\Files\Template\FieldType;
use Psr\Log\LoggerInterface;

Expand All @@ -34,12 +34,14 @@ public function extractFields(Node $file): array {
continue;
}

$templateFields[] = new Field(
$templateField = FieldFactory::createField(
(string)$index,
$field['FieldValue'],
$fieldType,
alias: $field['FieldName'],
);
$templateField->setValue($field['FieldValue']);
$templateField->alias = $field['FieldName'];

$templateFields[] = $templateField;
$index++;
}
return $templateFields;
Expand Down

0 comments on commit 9d42fc3

Please sign in to comment.