Skip to content

Commit

Permalink
Merge pull request #89 from rogierkoppejan/fix-issue-88
Browse files Browse the repository at this point in the history
Initialize File fields with label instead of type
  • Loading branch information
xiaohutai authored Sep 17, 2018
2 parents ffba4a2 + 4755e74 commit 1adcfad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Parser/Field/FieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ public static function build(
$type = new Date($field, $data, $config);
} elseif (!$data instanceof LazyCollection) {
if (($fieldType !== null) && in_array($fieldType, self::$fileTypes)) {
$type = new File($field, $data, $resourceManager, $config);
if (is_int($label)) {
$type = new File($field, $data, $resourceManager, $config);
} else {
$type = new File($label, $data, $resourceManager, $config);
}
$type->setFieldType($fieldType);
} else {
//We need to check if the label is an int. If it isn't then we'll use that for type (repeaters).
Expand Down

0 comments on commit 1adcfad

Please sign in to comment.