Jonathan Lahijani Posted 3 hours ago Share Posted 3 hours ago 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 Link to comment Share on other sites More sharing options...
elabx Posted 2 hours ago Share Posted 2 hours ago 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. Link to comment Share on other sites More sharing options...
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