on_duplicate

edited March 2013 in Modules
Hi there!

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?

Thanks and cheers!

Comments

  • edited 10:33AM
    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']).
  • edited 10:33AM
    Ok. But I need to know the original ID also, that is I will need both IDs in on_after_save. Is that possible?

    Thanks!
  • edited 10:33AM
    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.
  • edited 10:33AM
    Just for feedback: I found those, and probably could make use of this.

    Thanks!
Sign In or Register to comment.