Data for no longer existing block is kept in data

Hello, When i remove a block from the form and re-save the resource. The removed block (php side) data is still present in the database, altho no longer possible to be shown as the block is removed. This is the example scenario: I have this in my form:
Builder::make('content')
->blocks([
Builder\Block::make('paragraph1')
->schema([
Textarea::make('content1')
->label('Paragraph1')
->required(),
]),
Builder\Block::make('paragraph2')
->schema([
Textarea::make('content2')
->label('Paragraph2')
->required(),
]),
]);
Builder::make('content')
->blocks([
Builder\Block::make('paragraph1')
->schema([
Textarea::make('content1')
->label('Paragraph1')
->required(),
]),
Builder\Block::make('paragraph2')
->schema([
Textarea::make('content2')
->label('Paragraph2')
->required(),
]),
]);
Then i edit-save the resource and fill both paragraph1 & paragraph2 Then i remove paragraph2 from the form and it becomes this: I have this in my form:
Builder::make('content')
->blocks([
Builder\Block::make('paragraph1')
->schema([
Textarea::make('content1')
->label('Paragraph1')
->required(),
])
]);
Builder::make('content')
->blocks([
Builder\Block::make('paragraph1')
->schema([
Textarea::make('content1')
->label('Paragraph1')
->required(),
])
]);
Then i go and save the resource again and the data for paragraph2 is still in the json array in the database, what might be the cause how can i solve it?
1 Reply
Dimitar
Dimitar4mo ago
Hey @Dennis Koch any ideas on this one?