Skip to content

Commit abc62a4

Browse files
committed
Fixed form breaking when media is inside collections
1 parent c4e042b commit abc62a4

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Form/UxMediaCollectionType.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function configureOptions(OptionsResolver $resolver): void
3030
$entryOptionsNormalizer = function (Options $options, $value) {
3131
$value['conf'] = $options['conf'];
3232
$value['block_name'] = 'entry';
33+
$value['label'] = false;
3334

3435
return $value;
3536
};
@@ -49,9 +50,6 @@ public function configureOptions(OptionsResolver $resolver): void
4950
'tree' => 0,
5051
'error_bubbling' => false,
5152
'extra' => [],
52-
'entry_options' => [
53-
'label' => false
54-
]
5553
]);
5654

5755
$resolver->setRequired('conf');

templates/ux_media_form_theme.html.twig

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313

1414
{% block ux_media_row %}
1515
{{ form_label(form) }}
16-
<div data-arkounay--ux-collection--collection-target="collectionElement" >
16+
{% if 'ux_media_collection_entry' in block_prefixes %}
17+
{% set attr = attr|merge({'data-arkounay--ux-collection--collection-target': 'collectionElement'}) %}
18+
{% endif %}
19+
<div {% for k, v in attr|default %}{{ k }}="{{ v }}"{% endfor %}>
1720
{{ form_widget(form) }}
1821
{{ form_errors(form) }}
1922
{{ form_rest(form) }}
2023
</div>
21-
{% endblock %}
24+
{% endblock %}

0 commit comments

Comments
 (0)