-
Notifications
You must be signed in to change notification settings - Fork 890
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
[Bug] delete/deleting event not firing when using the delete button #5435
Comments
Hello there! Thanks for opening your first issue on this repo! Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that. Backpack communication channels:
Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch. Thank you! -- |
Hey @elythnwaen thanks for the question. I am not a fan of using model events in the fields. Some people are, and I think they work "okayish" for simpler scenarios, but then you start hitting this little corner cases and you realize you would just be better by not using the events in the fields. What does it means actually? So you setup your fields in When you click You have a few options here:
And... that's it. Hope it helps, I am going to close this as I don't think there is any issue here, I've just added a note about this scenario to our docs Laravel-Backpack/docs#548 Cheers 🙏 |
Setting the events on the setup() method fixed it, thanks! In case someone check it in the future:
Anyway issue solved for me. |
Bug report
What I did
Set up deleted/deleting events using the fluent syntax on my fields.
Then pushed the delete button to remove an entry and test it.
What I expected to happen
Execute the code in the event.
What happened
Nothing
What I've already tried to fix it
I tested other events (creating, created, saving, saved, updating, updated), they work fine.
Is it a bug in the latest version of Backpack?
Not sure, I didn’t try it in previous versions, but from what I found while searching for it, it seems like it did work at some point at least.
After I run
composer update backpack/crud
the bug... is it still there?Yes
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:PHP VERSION:
PHP 8.2.10 (cli) (built: Aug 29 2023 21:51:44) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.2.10, Copyright (c) Zend Technologies
LARAVEL VERSION:
10.29.0.0
BACKPACK PACKAGE VERSIONS:
backpack/backupmanager: v5.0.0
backpack/basset: 1.2.1
backpack/crud: 6.6.1
backpack/generators: v4.0.2
backpack/permissionmanager: 7.1.0
backpack/pro: 2.0.18
backpack/theme-coreuiv4: 1.1.1
The text was updated successfully, but these errors were encountered: