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 <jus@bitgrid.net>

[skip ci]
  • Loading branch information
juliushaertl authored and backportbot[bot] committed Aug 28, 2024
1 parent 4eb1cd1 commit 960e58f
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 960e58f

Please sign in to comment.