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 11:19PM
    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 11:19PM
    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 11:19PM
    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 11:19PM
    Just for feedback: I found those, and probably could make use of this.

    Thanks!
Sign In or Register to comment.