Is it possible to get the id when the duplicate is saved. I need to create items in another table that also needs to be duplicated and with new id's. Can I send something through to on_after_save or similar?
on_duplicate is called before it is saved and therefore doesn't have the ID. To get the id of the duplicate, you can use the on_after_save model hook. It will have the id value passed to it in the $values array which is the first and only parameter passed to the on_after_save hook (e.g. $values['id']).
In the latest 1.0 beta version (as of last week), there is a hidden field that gets set of "__fuel_id__" which you could use to grab the original duplicate ID value.
Comments
Thanks!
Thanks!