Form Relations not firing Model Observers?
So instead of the hooks, I have observer for the models. This happens to be in a form relation.
My problem is that the observer aren't firiing when I add a new item of the relationship's Repeater field.
Also not getting fired after updating the fields inside the repeater.
How can I successfully tap into it? My goal is to send email whenever it add items and update items inside the repeater field.
Thanks!
5 Replies
observers fire when stuff is saved
adding an item to the repeater does not save it
I meant when saving and updating the repeater items. Nothing happens.
Nothing is going to happen. Adding / deleting an item only updates the state of the form, it doesn’t update the record in db.
What's the best way to listen on those changes?
afterStateUpdated() on the repeater. But I not sure any model should be updated on the state change. Otherwise you loose the ability to throw out the changes if they were unintentional or by mistake.