[Bug] Deleting last relation tries to update this record and throws an error
See original GitHub issueBug report
What I did
I added a relationship with multiple fields. I can add multiple relationship records. When I delete a relationship record it works exept when I try to delete the last record. Then it tries to update this record with an empty parent Id, and thus throwing an error “Cannot insert the value NULL into column …”
What I expected to happen
Delete the record and not update with emtpy parent ID
Is it a bug in the latest version of Backpack?
Yes
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version
the output is:
PHP VERSION:
PHP 7.4.21 (cli) (built: Jul 1 2021 16:09:23) ( NTS ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies with Zend OPcache v7.4.21, Copyright ©, by Zend Technologies
LARAVEL VERSION:
v8.83.1@bddba117f8bce2f3c9875ca1ca375a96350d0f4d
BACKPACK VERSION:
5.0.6@2be4ff8407259f528a3541f0569ce156bab63165
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
13766: No rows were affected by the update or delete operation
I try make new DNS in ODBC with connection to MDB file. In this DNS work update records fine. This seems must be...
Read more >Error when you update a row of a table - SQL Server
This article provides a workaround for the problem that occurs when you try to update a table by using SQL Server Management Studio...
Read more >Eloquent model terrible bug (Delete all table rows!) #12038
Hi there, Last day I found a terrible bug (I guess) in Laravel Eloquent model which cause loosing all of my data! Imagine...
Read more >Hibernate - Batch update returned unexpected row count from ...
The solution is to use select for update when fetching the record to lock the row, so nothing else can delete it before...
Read more >Error 'Your attempt to delete record name could not be ...
This issue is therefore caused if there is a custom Lookup relationship on Leads with Contacts, and is set so that if you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks, learned something today! I downloaded the changes as explained, removed the ‘force_delete’ => true and the problem is gone! Solved!
Going to close, let’s keep the conversation in the PR thread if needed!
Thanks again @howest-ward