<commit_before>{#

This file is part of the Sonata package.

(c) <NAME> <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}
{% if sonata_admin.field_description.hasassociationadmin %}
    <div id="field_container_{{ id }}" class="field-container">
        <span id="field_widget_{{ id }}" >
            {% if sonata_admin.edit == 'inline' %}
                {% if sonata_admin.inline == 'table' %}
                    {% if form.children|length > 0 %}
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    {% for field_name, nested_field in (form.children|first).children %}
                                        {% if field_name == '_delete' %}
                                            <th>{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}</th>
                                        {% else %}
                                            <th
                                                {% if nested_field.vars['required']|default(false) %}
                                                    class="required"
                                                {% endif %}
                                            >
                                                {{ nested_field.vars.label|trans({}, nested_field.vars['sonata_admin'].admin.translationDomain) }}
                                            </th>
                                        {% endif %}
                                    {% endfor %}
                                </tr>
                            </thead>
                            <tbody class="sonata-ba-tbody">
                                {% for nested_group_field_name, nested_group_field in form.children %}
                                    <tr>
                                        {% for field_name, nested_field in nested_group_field.children %}
                                            <td
                                                class="sonata-ba-td-{{ id }}-{{ field_name }} form-group control-group
                                                {% if nested_field.vars.errors|default(false) %} error has-error sonata-ba-field-error{% endif %}"
                                            >
                                                {% if sonata_admin.field_description.associationadmin.hasformfielddescriptions(field_name) is defined %}
                                                    {{ form_widget(nested_field) }}

                                                    {% set dummy = nested_group_field.setrendered %}
                                                {% else %}
                                                    {{ form_widget(nested_field) }}
                                                {% endif %}
                                                {% if nested_field.vars.errors|default(false) %}
                                                    <div class="help-block help-inline sonata-ba-field-error-messages">
                                                        {{ form_errors(nested_field) }}
                                                    </div>
                                                {% endif %}
                                            </td>
                                        {% endfor %}
                                    </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    {% endif %}
                {% elseif form.children|length > 0 %}
                    <div>
                        {% for nested_group_field_name, nested_group_field in form.children %}
                            {% for field_name, nested_field in nested_group_field.children %}
                                {% if sonata_admin.field_description.associationadmin.hasformfielddescriptions(field_name) is defined %}
                                    {{ form_row(nested_field) }}
                                    {% set dummy = nested_group_field.setrendered %}
                                {% else %}
                                    {% if nested_field.vars.name == '_delete' %}
                                        {{ form_row(nested_field, { 'label': ('action_delete'|trans({}, 'SonataAdminBundle')) }) }}
                                    {% else %}
                                        {{ form_row(nested_field) }}
                                    {% endif %}
                                {% endif %}
                            {% endfor %}
                        {% endfor %}
                    </div>
                {% endif %}
            {% else %}
                {{ form_widget(form) }}
            {% endif %}

        </span>

        {% if sonata_admin.edit == 'inline' %}

            {% if sonata_admin.field_description.associationadmin.hasRoute('create')
                and sonata_admin.field_description.associationadmin.hasAccess('create')
                and btn_add %}
                <span id="field_actions_{{ id }}" >
                    <a
                        href="{{ sonata_admin.field_description.associationadmin.generateUrl('create', sonata_admin.field_description.getOption('link_parameters', {})) }}"
                        onclick="return start_field_retrieve_{{ id }}(this);"
                        class="btn btn-success btn-sm sonata-ba-action"
                        title="{{ btn_add|trans({}, btn_catalogue) }}"
                        >
                        <i class="fa fa-plus-circle"></i>
                        {{ btn_add|trans({}, btn_catalogue) }}
                    </a>
                </span>
            {% endif %}

            {# include association code #}
            {% include '@SonataAdmin/CRUD/Association/edit_one_script.html.twig' %}

        {% else %}
            <div id="field_container_{{ id }}" class="field-container">
                <span id="field_widget_{{ id }}" >
                    {{ form_widget(form) }}
                </span>

                <span id="field_actions_{{ id }}" class="field-actions">
                    {% if sonata_admin.field_description.associationadmin.hasRoute('create')
                        and sonata_admin.field_description.associationadmin.hasAccess('create')
                        and btn_add %}
                        <a
                            href="{{ sonata_admin.field_description.associationadmin.generateUrl('create', sonata_admin.field_description.getOption('link_parameters', {})) }}"
                            onclick="return start_field_dialog_form_add_{{ id }}(this);"
                            class="btn btn-success btn-sm sonata-ba-action"
                            title="{{ btn_add|trans({}, btn_catalogue) }}"
                            >
                            <i class="fa fa-plus-circle"></i>
                            {{ btn_add|trans({}, btn_catalogue) }}
                        </a>
                        {% include '@SonataAdmin/CRUD/Association/edit_modal.html.twig' %}
                        {% include '@SonataAdmin/CRUD/Association/edit_many_script.html.twig' %}
                    {% endif %}
                </span>
            </div>
        {% endif %}
    </div>
{% endif %}
<commit_msg>Fix bug "Field "FIELD" has already been rendered" in /CRUD/Association/edit_many_to_many.html.twig (line 111)<commit_after>{#

This file is part of the Sonata package.

(c) <NAME> <<EMAIL>>

For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.

#}
{% if sonata_admin.field_description.hasassociationadmin %}
    <div id="field_container_{{ id }}" class="field-container">
        <span id="field_widget_{{ id }}" >
            {% if sonata_admin.edit == 'inline' %}
                {% if sonata_admin.inline == 'table' %}
                    {% if form.children|length > 0 %}
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    {% for field_name, nested_field in (form.children|first).children %}
                                        {% if field_name == '_delete' %}
                                            <th>{{ 'action_delete'|trans({}, 'SonataAdminBundle') }}</th>
                                        {% else %}
                                            <th
                                                {% if nested_field.vars['required']|default(false) %}
                                                    class="required"
                                                {% endif %}
                                            >
                                                {{ nested_field.vars.label|trans({}, nested_field.vars['sonata_admin'].admin.translationDomain) }}
                                            </th>
                                        {% endif %}
                                    {% endfor %}
                                </tr>
                            </thead>
                            <tbody class="sonata-ba-tbody">
                                {% for nested_group_field_name, nested_group_field in form.children %}
                                    <tr>
                                        {% for field_name, nested_field in nested_group_field.children %}
                                            <td
                                                class="sonata-ba-td-{{ id }}-{{ field_name }} form-group control-group
                                                {% if nested_field.vars.errors|default(false) %} error has-error sonata-ba-field-error{% endif %}"
                                            >
                                                {% if sonata_admin.field_description.associationadmin.hasformfielddescriptions(field_name) is defined %}
                                                    {{ form_widget(nested_field) }}

                                                    {% set dummy = nested_group_field.setrendered %}
                                                {% else %}
                                                    {{ form_widget(nested_field) }}
                                                {% endif %}
                                                {% if nested_field.vars.errors|default(false) %}
                                                    <div class="help-block help-inline sonata-ba-field-error-messages">
                                                        {{ form_errors(nested_field) }}
                                                    </div>
                                                {% endif %}
                                            </td>
                                        {% endfor %}
                                    </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    {% endif %}
                {% elseif form.children|length > 0 %}
                    <div>
                        {% for nested_group_field_name, nested_group_field in form.children %}
                            {% for field_name, nested_field in nested_group_field.children %}
                                {% if sonata_admin.field_description.associationadmin.hasformfielddescriptions(field_name) is defined %}
                                    {{ form_row(nested_field) }}
                                    {% set dummy = nested_group_field.setrendered %}
                                {% else %}
                                    {% if nested_field.vars.name == '_delete' %}
                                        {{ form_row(nested_field, { 'label': ('action_delete'|trans({}, 'SonataAdminBundle')) }) }}
                                    {% else %}
                                        {{ form_row(nested_field) }}
                                    {% endif %}
                                {% endif %}
                            {% endfor %}
                        {% endfor %}
                    </div>
                {% endif %}
            {% else %}
                {{ form_widget(form) }}
            {% endif %}

        </span>

        {% if sonata_admin.edit == 'inline' %}

            {% if sonata_admin.field_description.associationadmin.hasRoute('create')
                and sonata_admin.field_description.associationadmin.hasAccess('create')
                and btn_add %}
                <span id="field_actions_{{ id }}" >
                    <a
                        href="{{ sonata_admin.field_description.associationadmin.generateUrl('create', sonata_admin.field_description.getOption('link_parameters', {})) }}"
                        onclick="return start_field_retrieve_{{ id }}(this);"
                        class="btn btn-success btn-sm sonata-ba-action"
                        title="{{ btn_add|trans({}, btn_catalogue) }}"
                        >
                        <i class="fa fa-plus-circle"></i>
                        {{ btn_add|trans({}, btn_catalogue) }}
                    </a>
                </span>
            {% endif %}

            {# include association code #}
            {% include '@SonataAdmin/CRUD/Association/edit_one_script.html.twig' %}

        {% else %}
            <div id="field_container_{{ id }}" class="field-container">
                <span id="field_actions_{{ id }}" class="field-actions">
                    {% if sonata_admin.field_description.associationadmin.hasRoute('create')
                        and sonata_admin.field_description.associationadmin.hasAccess('create')
                        and btn_add %}
                        <a
                            href="{{ sonata_admin.field_description.associationadmin.generateUrl('create', sonata_admin.field_description.getOption('link_parameters', {})) }}"
                            onclick="return start_field_dialog_form_add_{{ id }}(this);"
                            class="btn btn-success btn-sm sonata-ba-action"
                            title="{{ btn_add|trans({}, btn_catalogue) }}"
                            >
                            <i class="fa fa-plus-circle"></i>
                            {{ btn_add|trans({}, btn_catalogue) }}
                        </a>
                        {% include '@SonataAdmin/CRUD/Association/edit_modal.html.twig' %}
                        {% include '@SonataAdmin/CRUD/Association/edit_many_script.html.twig' %}
                    {% endif %}
                </span>
            </div>
        {% endif %}
    </div>
{% endif %}

{'fraction_non_alphanumeric': 0.10564331038207102, 'fraction_numerical': 0.00047252598892939113, 'mean_word_length': 0.9401519119958093, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 91, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 154, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4043903', 'n_tokens_mistral': 3363, 'n_tokens_neox': 2974, 'n_words': 534}