Fixed problems with non-unique prototype names when using nested collection type, which prevented to create nested entries with mulitple new sub entries.

We now use a unique prototype name for every collection field. This fixes issue #219
This commit is contained in:
Jan Böhmer 2023-02-19 22:39:26 +01:00
parent 1e998fccbb
commit 9d1cd0477a
3 changed files with 25 additions and 2 deletions

View file

@ -4,11 +4,13 @@
'deleteMessage': deleteMessage|trans,
'prototype': form_widget(form.vars.prototype)|e('html_attr'),
'rowsToDelete': rowsToDelete,
'fieldPlaceholder': form.vars.prototype_name
}) }}
{% else %} {# If add_element is disabled/forbidden, prototype is not available #}
{{ stimulus_controller('elements/collection_type', {
'deleteMessage': deleteMessage|trans,
'rowsToDelete': rowsToDelete
'rowsToDelete': rowsToDelete,
'fieldPlaceholder': form.vars.prototype_name
}) }}
{% endif %}
{% endmacro %}