Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Form] ContextErrorException in FileType #25063

Copy link
Copy link
Closed
@chihiro-adachi

Description

@chihiro-adachi
Issue body actions
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 2.7.38, 3.3.13

In symfony 2.7.38 / 3.3.13, the following warning occurred with FileType.

ContextErrorException in FileType.php line 43:
Warning: Invalid argument supplied for foreach()

It is reproduced with the following code. (I am using Silex)

        $builder = $app['form.factory']->createBuilder();
        $builder->add('file', FileType::class, [
            'multiple' => true,
        ]);

        $form->submit([]);

$event->getData() returns null, so it appears to be warned by foreach ().

https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/FileType.php#L38

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.