Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Fragment deletion is not flagged anymore #278

Closed
srascar opened this issue Jun 29, 2021 · 4 comments · Fixed by #280
Closed

Fragment deletion is not flagged anymore #278

srascar opened this issue Jun 29, 2021 · 4 comments · Fixed by #280

Comments

@srascar
Copy link
Contributor

srascar commented Jun 29, 2021

Sonata packages

sonata-project/admin-bundle            3.88.0
sonata-project/article-bundle            1.5.0

Subject

The support for the _delete field has been lost when submitting the fragment form field

Steps to reproduce

  • Create an ArticleAdmin
  • Create a fragments field of type collection
  • Edit the article to add a fragment
  • Remove the fragment and submit the form
  • Dump the value of _delete in pre_bind_data_callback
    ex:
$formMapper
            ->add('fragments', CollectionType::class, [
                'constraints'  => [new Valid()],
                'by_reference' => false,
                'label'        => false,
                'pre_bind_data_callback' => function ($value) {
                    dump($value);

                    // ...

Expected results

When the fragment has beed deleted, $value where the key id corresponds to the deleted fragment should contain a _delete key

Actual results

$value where the key id corresponds to the deleted fragment is never received

@VincentLanglet
Copy link
Member

The support for the _delete field has been lost when submitting the fragment form field

Do you know in which version ?

@srascar
Copy link
Contributor Author

srascar commented Jun 29, 2021

@VincentLanglet
Copy link
Member

Do you know how to fix this ? Can you do the PR ? :)

@srascar
Copy link
Contributor Author

srascar commented Jun 29, 2021

Started #280

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants