U4-2450 - ContentService.Created event does not get content with ID

Created by Casey Neehouse 02 Jul 2013, 19:29:18 Updated by Morten Christensen 04 Jul 2013, 10:31:59

When creating content through the back office, the ContentService.Created event does not pass the content item with the created ID. Thus, the old Document API (which is used for the dialog), is not creating the content with Identity.

Thus, ContentService.Created is not usable to do any events on unless creating content through code.


Casey Neehouse 02 Jul 2013, 19:34:12

Well, not so simple, as the document may get cancelled in the Document event, which is a problem.

How do we raise an event on the creation of a new content node that is created in the back office with the new API. The old API works fine the way it is set up.

Need a FirstSave Event?

Morten Christensen 02 Jul 2013, 19:56:28

We recently added a method for creating and persisting a content item in one go, so we could switch the backoffice to use this method so the created event is triggered with a content item with an id set.

Just out of curiosity, what do you need the Id for in Created rather then Saved/Saving.?

Casey Neehouse 02 Jul 2013, 20:08:13

Only need the event on initial save. I create an item, it creates child items...

Example, creating a blog may create a categories folder. A new News area may create a archives folder, etc.

If changing the old API, then you lose the ability to cancel the create unless you move the newing event to before.

Morten Christensen 02 Jul 2013, 20:22:57

You can work around it by calling save with "raiseEvents: false" in the Created event in order to give the created item an id. You'll get an extra save operation but it shouldn't matter. And as long as you pass false on the optional raiseEvents parameter you won't trigger the Saving/Saved events within the Created event handler.

Casey Neehouse 02 Jul 2013, 20:27:10

Good call.

Priority: Normal

Type: Bug

State: Fixed

Assignee: Morten Christensen

Difficulty: Normal

Category: UI

Backwards Compatible: False

Fix Submitted:

Affected versions: 6.1.1, 6.0.6

Due in version: 6.1.3


Story Points: