Skip to content

Commit

Permalink
Merge pull request #18 from Wanere/patch-3
Browse files Browse the repository at this point in the history
Update sentence : README.md
  • Loading branch information
DjLeChuck authored Oct 29, 2019
2 parents ddd8a15 + a12065c commit c3ac873
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ $builder->add('content', PanelType::class, [
```

#### Troubleshooting block deletion
For some unknown reason, blocks are not properly deleted on saving the form, probably because no update is detected. To solve this, you need to create an event on `preUpdate` (in your Sonata Admin for example), to be triggered when you save the form.
Blocks are only removed on the `preUpdate` of the parent entity: if the only modification done on the form is the deletion of a block, the preUpdate event is not triggered, so the block will not be removed.

To solve this, you need to create an event on `preUpdate` (in your Sonata Admin for example), to be triggered when you save the form.
```php
public function preUpdate($object)
{
Expand Down

0 comments on commit c3ac873

Please sign in to comment.