mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Modified DefaultContentManager to trigger Publishing handlers when Create() is called with Version.Publish argument
--HG-- branch : dev
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user