admin: do not use disabled for form widget with collections, see https://github.com/symfony/symfony/issues/18998

This commit is contained in:
nobohan 2022-05-25 11:45:25 +02:00
parent 354c37ade2
commit bc410b02e7

View File

@ -8,9 +8,20 @@
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block crud_content_form_rows %}
<div class="mb-3 row">
<label class="col-form-label col-sm-4 required" for="social_action_ordering">{{ 'Parent'|trans }}</label>
<div class="col-sm-8">{{ entity.parent|chill_entity_render_box }}</div>
</div>
<div class="mb-3 row">
<label class="col-form-label col-sm-4 required" for="social_action_ordering">{{ 'Social issue'|trans }}</label>
<div class="col-sm-8">{{ entity.issue|chill_entity_render_box }}</div>
</div>
{% for f in form %}
{% if f.vars.name == 'parent' or f.vars.name == 'issue' %}
{{ form_row(f, { 'attr':{'disabled':'disabled'}}) }}
{{ form_widget(f, { 'attr':{'hidden':'hidden'}}) }}
{% else %}
{{ form_row(f) }}
{% endif %}