Skip to content

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Parser/Field/FieldFactory.php

+5-1
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)