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] Form parent can't be accessed if form has a child named "parent" in Twig. #28686

Copy link
Copy link
Closed
@moynzzz

Description

@moynzzz
Issue body actions

Symfony version(s) affected: All

Description
If you have a form that has a child named parent there is no possible way to access the parent variable in Twig.

How to reproduce
Create a simple form and have a child named parent. Then try in the twig template to access the actual form parent. The form.parent returns the child.

The problem with this issue is that it is related to how twig accesses properties of an object not specifically to the form component because in PHP there will be no problem to access the parent form or the child named parent. Should I open an issue in the twig repository instead?

Note that this works the same with all other FormView's properties vars and children.

I found this bug when I tried to fix this issue EasyCorp/EasyAdminBundle#2228 and more specific information can be found there.

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.