Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change how some form fields are not displayed #885

Open
marien-probesys opened this issue Dec 13, 2024 · 0 comments
Open

Change how some form fields are not displayed #885

marien-probesys opened this issue Dec 13, 2024 · 0 comments
Labels
easy task Good for first time contributors ready ✅ You can work on this! technical debt The past will not stop us from moving forward
Milestone

Comments

@marien-probesys
Copy link
Member

Problem

Some form fields are not displayed in different situations. Most of the time, it's because a collection field is empty. If we don't render these fields, Symfony generates them when calling form_end. So we mark them as rendered by calling field_name(form.field) in a HTML comment. This is pretty hacky, and not robust.

Solution

Replace all the <!-- field_name(form.field) --> by {% do form.field.setRendered %}

@marien-probesys marien-probesys added easy task Good for first time contributors type: technical technical debt The past will not stop us from moving forward labels Dec 13, 2024
@marien-probesys marien-probesys added this to the Version 1.0 milestone Dec 13, 2024
@marien-probesys marien-probesys added the ready ✅ You can work on this! label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy task Good for first time contributors ready ✅ You can work on this! technical debt The past will not stop us from moving forward
Projects
None yet
Development

No branches or pull requests

1 participant