Closed BernhardBaumrock closed 2 years ago
@BernhardBaumrock The trashed hook covers just the page that was moved to the trash. If it has children, that's for the hooker to decide what they want to do with them. It was written this way because it can't guarantee success if it has to load every child and provide each to the hook in a separate call. It might very well run out of memory if there are a lot of them. We don't operate on every single page until the trash is emptied, at which point we provide an interactive mechanism for dealing with more pages than can fit in memory.
Thx for clarifying @ryancramerdesign makes sense :)
Short description of the issue
Not sure if this is an issue or intended. I have a typical parent-child setup like this:
Then I have a hook that is executed on Pages::trashed (in my case it calls an external API to remove the client from the remote system).
When I trash Client 3 the hook is executed and the external client is also removed. Good.
Then I trashed the "Clients" page (meaning that also Client 1 + 2 are moved to the trash), but the hook did not fire for either one of them.
Expected behavior
I'm not sure if Pages::trashed should fire for Client 1+2 if the parent "Clients" page is being trashed? In my case this is what I'd expect...