Skip to content

Commit

Permalink
Merge pull request #12 from lopes-vincent/patch-1
Browse files Browse the repository at this point in the history
Fix file upload for symfony/form 2.8.49
  • Loading branch information
gillesbourgeat authored Mar 15, 2019
2 parents f370cbb + d1f4007 commit 674a18a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Config/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<language>en_US</language>
<language>fr_FR</language>
</languages>
<version>1.3.1</version>
<version>1.3.2</version>
<author>
<name>Gilles Bourgeat</name>
<email>gilles.bourgeat@gmail.com</email>
Expand Down
11 changes: 8 additions & 3 deletions Form/Type/AttributeTypeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ class AttributeTypeType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$formOptions = ['required' => true];

// Fix for symfony/form 2.8.49
if (isset($options['allow_file_upload'])) {
$formOptions['allow_file_upload'] = true;
}

$builder->add(
'attribute_type',
'collection',
array(
'type' => 'text',
'allow_add' => true,
'allow_delete' => true,
'options' => array(
'required' => true
)
'options' => $formOptions
)
);
}
Expand Down

0 comments on commit 674a18a

Please sign in to comment.