When copying a page I raise a Copied-event which is looking on the document type. If it matches a specific type if should set the CreatorId to the logged in user.
I seems at the moment the CreatorId is always set to the root user (e g ID: 0).
private void ContentService_Copied(IContentService sender, CopyEventArgs<IContent> e)
{
var item = e.Copy;
var original = e.Original;
if (item == null || original == null || item.ContentType.Alias != "myDocTypeAlias") return;
item.CreatorId = original.CreatorId; // This does not set the CreatorId
}
How would I go about to making the change in Creator field stick?
Setting CreatorId then copying a page
Hi.
When copying a page I raise a Copied-event which is looking on the document type. If it matches a specific type if should set the CreatorId to the logged in user. I seems at the moment the CreatorId is always set to the root user (e g ID: 0).
How would I go about to making the change in Creator field stick?
using cms version 7.5.4
Edit: see that same question is asked here: https://our.umbraco.com/forum/umbraco-7/using-umbraco-7/57287-How-to-set-the-creator-or-writer-of-a-content-item-in-a-controller-action#comment-325917
is working on a reply...