Event when creating new draft in new site #14678
-
Hi, Is it possible to hook on the event when creating a new entry / draft on another site? When we enable a new site (the section's propation method is set to "Let each entry choose which sites it should be saved to"), we want to prefill some fields from an api endpoint, so we only need the newly created entry, but for some reason we get the current entry when triggering the following hook: We tried checking the Looked at this with @janhenckens @carolineboeykens and we couldn't figure it out. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
When you add a new site to an entry, the entry is saved from the current site, so it’s expected that |
Beta Was this translation helpful? Give feedback.
-
hey @brandonkelly Thank you for the swift response! |
Beta Was this translation helpful? Give feedback.
When you add a new site to an entry, the entry is saved from the current site, so it’s expected that
siteId
will be the old site fromEVENT_AFTER_PROPAGATE
. But$entry->newSiteIds
will be set to an array with the newly-added site’s ID, so that’s what you’re going to want to look for.