Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 1adcfad

Browse files
authored
Merge pull request #89 from rogierkoppejan/fix-issue-88
Initialize File fields with label instead of type
2 parents ffba4a2 + 4755e74 commit 1adcfad

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Parser/Field/FieldFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ public static function build(
105105
$type = new Date($field, $data, $config);
106106
} elseif (!$data instanceof LazyCollection) {
107107
if (($fieldType !== null) && in_array($fieldType, self::$fileTypes)) {
108-
$type = new File($field, $data, $resourceManager, $config);
108+
if (is_int($label)) {
109+
$type = new File($field, $data, $resourceManager, $config);
110+
} else {
111+
$type = new File($label, $data, $resourceManager, $config);
112+
}
109113
$type->setFieldType($fieldType);
110114
} else {
111115
//We need to check if the label is an int. If it isn't then we'll use that for type (repeaters).

0 commit comments

Comments
 (0)