Modified DefaultContentManager to trigger Publishing handlers when Create() is called with Version.Publish argument

--HG--
branch : dev
This commit is contained in:
Sebastien Ros
2010-06-03 17:40:33 -07:00
parent a712d04743
commit cac40c37a6

View File

@@ -336,6 +336,20 @@ namespace Orchard.ContentManagement {
foreach (var handler in Handlers) {
handler.Created(context);
}
if(options.IsPublished) {
var publishContext = new PublishContentContext(contentItem, null);
// invoke handlers to acquire state, or at least establish lazy loading callbacks
foreach ( var handler in Handlers ) {
handler.Publishing(publishContext);
}
// invoke handlers to acquire state, or at least establish lazy loading callbacks
foreach ( var handler in Handlers ) {
handler.Published(publishContext);
}
}
}
public ContentItemMetadata GetItemMetadata(IContent content) {