Closed srascar closed 3 years ago
sonata-project/admin-bundle 3.88.0 sonata-project/article-bundle 1.5.0
The support for the _delete field has been lost when submitting the fragment form field
_delete
Dump the value of _delete in pre_bind_data_callback ex:
pre_bind_data_callback
$formMapper ->add('fragments', CollectionType::class, [ 'constraints' => [new Valid()], 'by_reference' => false, 'label' => false, 'pre_bind_data_callback' => function ($value) { dump($value); // ...
When the fragment has beed deleted, $value where the key id corresponds to the deleted fragment should contain a _delete key
id
$value where the key id corresponds to the deleted fragment is never received
Do you know in which version ?
It happened on tag 1.3 https://github.com/sonata-project/SonataArticleBundle/commit/2a52eeda78328ef22ca819ec5210f5fdbb702d93#diff-ae864fbf4f9062ada8c1e8d888855a8f8b622efb0066e1ddcf7a0cf9d63b96e8L188
Do you know how to fix this ? Can you do the PR ? :)
Started https://github.com/sonata-project/SonataArticleBundle/pull/280
Sonata packages
Subject
The support for the
_delete
field has been lost when submitting the fragment form fieldSteps to reproduce
Dump the value of
_delete
inpre_bind_data_callback
ex:Expected results
When the fragment has beed deleted, $value where the key
id
corresponds to the deleted fragment should contain a_delete
keyActual results
$value where the key
id
corresponds to the deleted fragment is never received