Jonathan Lahijani Posted December 12, 2024 Posted December 12, 2024 I have a page that has a two repeater fields. Those two repeater fields have nested repeaters, etc. I want to run a hook after the page has been saved, BUT only after all the repeaters and nested repeaters have been saved as well. If I use addHookAfter on Pages::saved(template=mytemplate), the hook fires after the page is saved, but before all the repeaters and nester repeaters are saved. What's the correct way to do this? 1
elabx Posted December 12, 2024 Posted December 12, 2024 Maybe use a nested hook? $wire->addHookAfter(Pages::saved(template=repeater_parent_repeater), function($e){ $e->addHookAfter(Pages::saved(template=repeater_nested_repeater), function($e){ // ProcessWire magic! }); }); Just be sure it's not executing in odd places.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now