Skip to content

Commit 88fd1a0

Browse files
committed
Multiple files upload compatibility
1 parent 1f94045 commit 88fd1a0

2 files changed

Lines changed: 3 additions & 24 deletions

File tree

src/Integration/Symfony/Form/WebFileType.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,8 @@ public function configureOptions(OptionsResolver $resolver): void
385385
return false;
386386
}
387387

388-
if (
389-
true === $options['removable']
390-
|| true === $options['image']
391-
) {
392-
throw new InvalidOptionsException(
393-
"'multiple' option is forbidden when 'removable' or 'image' option is set"
394-
);
388+
if (true === $options['removable']) {
389+
throw new InvalidOptionsException("'multiple' option is forbidden when 'removable' option is set");
395390
}
396391

397392
if ('none' !== $options['direct_upload']['mode']) {

tests/functional/Integration/Symfony/Form/WebFileTypeCest.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static function () use ($formFactory): void {
259259
new InvalidOptionsException(
260260
sprintf(
261261
'An error has occurred resolving the options of the form "%s": '
262-
. "'multiple' option is forbidden when 'removable' or 'image' option is set",
262+
. "'multiple' option is forbidden when 'removable' option is set",
263263
WebFileType::class
264264
)
265265
),
@@ -271,22 +271,6 @@ static function () use ($formFactory): void {
271271
}
272272
);
273273

274-
$I->expectThrowable(
275-
new InvalidOptionsException(
276-
sprintf(
277-
'An error has occurred resolving the options of the form "%s": '
278-
. "'multiple' option is forbidden when 'removable' or 'image' option is set",
279-
WebFileType::class
280-
)
281-
),
282-
static function () use ($formFactory): void {
283-
$formFactory->create(WebFileType::class, null, [
284-
'multiple' => true,
285-
'image' => true,
286-
]);
287-
}
288-
);
289-
290274
$form = $formFactory->create(WebFileType::class, null, [
291275
'direct_upload' => [
292276
'mode' => 'entity',

0 commit comments

Comments
 (0)