-
-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User Model forceDelete doesn't remove the record from the DB #951
Comments
My setup:
This error shows up in the modal when trying to force delete a user In the browser console doesn't come up anything, the response to the Commenting #L192 in the User model the error disappears but it still performs SoftDelete. I also checked in UF 4.1 and the bug is also there (no error shows up), so it shouldn't be caused by the foreign key added in UF 4.2 . |
This bug is successfully replicated on the We're still on 5.4, which explain why we're still seeing this. There is not much we can do for now I guess. I'll leave this issue open and mark it for UF 4.3 so we can confirm it is indeed fixed when we update our Laravel dependency. |
That issue is not exactly the same bug, it is still a problem but the bug here is being unable to perform hard deletes even without having already soft-deleted the user. I started digging a little bit more into this problem and I think there are three possible causes, the last 2 are about the error I got:
The first I think could be easily fixed with the edits I wrote above (although there is the possibility of unpredictable behaviour of the code like in the snippet). I'm not an expert PHP coder so I'm likely missing something. I'd love some kind of feedback, if needed I could also work on a PR. |
Actually, you're right. I got distracted by another test I did. Your first point was right on target. That's why changing Should be fixed in commit 3790e4f, I'll merge into |
Yes, it makes perfectly sense. Since you could not reproduce the error I got in the modal, I guess it depends on the DB server.
And this is how my
|
Hum, you might be right again. Delete might be missing some cleanup. I wonder if we would need to delete roles or other tables. Delete cascade would be easier indeed. |
Well, the cleaning of roles works well with |
Hum, can you open a new issue about this, as this one has already been merged? Thanks. |
When using the User model
forceDelete
option ($user->delete(true)
), the record is still soft deleted, not removed from the db. Thedelete
method doesn't seam to return true as supposed to. Possible user facing error too : https://chat.userfrosting.com/channel/support?msg=QbMRJX7uhHHahFLZiThe text was updated successfully, but these errors were encountered: