Skip to content

Sandbox mode form_errors exception #4820

Description

@pgoddijn123inkt

Hi everybody,

With the release of twig 3.27.0 form_errors() is broken in the sandbox environment when you pass it a Symfony\Component\Form\FormView.

An exception has been thrown during the rendering of a template ("Symfony\Component\Form\FormRenderer::searchAndRenderBlock(): Argument #1 ($view) must be of type Symfony\Component\Form\FormView, array given

The cause seems to be changes to ensureToStringAllowed() / doEnsureToStringAllowed() in baebc46

Because FormView is Traversable, it gets cast to array, which causes the provided exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions