You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a repeatable field on a hasMany relationship, if there is one record and the repeatable field doesn't have a 'force_delete' => true attribute, if you try to delete that sole entry then it tries to update the single entry with a foreign_key_id of null, instead of deleting it.
What I did
Adding a 'force_delete' => true to the relationship field makes it delete, if not then it passes down to
Bug report
When using a repeatable field on a
hasMany
relationship, if there is one record and therepeatable
field doesn't have a'force_delete' => true
attribute, if you try to delete that sole entry then it tries to update the single entry with a foreign_key_id ofnull
, instead of deleting it.What I did
Adding a
'force_delete' => true
to the relationship field makes it delete, if not then it passes down toCRUD/src/app/Library/CrudPanel/Traits/Create.php
Line 271 in 2be4ff8
What I expected to happen
When removing the sole entry in the relationship, it should delete the entry in the related model table
What happened
It tried to set the
user_id
value to null.What I've already tried to fix it
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there?Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:The text was updated successfully, but these errors were encountered: