File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed
OrchardCore.Modules/OrchardCore.Contents/Workflows
OrchardCore/OrchardCore.Abstractions Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,22 @@ public override void ConfigureServices(IServiceCollection services)
28
28
services . AddActivity < RetrieveContentTask , RetrieveContentTaskDisplayDriver > ( ) ;
29
29
services . AddActivity < UpdateContentTask , UpdateContentTaskDisplayDriver > ( ) ;
30
30
31
- services . AddScoped < IContentHandler , ContentsHandler > ( ) ;
32
31
services . AddScoped < IWorkflowValueSerializer , ContentItemSerializer > ( ) ;
33
32
}
34
33
}
34
+
35
+ [ RequireFeatures ( "OrchardCore.Workflows" ) ]
36
+ public sealed class ContentHandlerStartup : StartupBase
37
+ {
38
+ // The order is set to OrchardCoreConstants.ConfigureOrder.WorkflowsContentHandlers to ensure the workflows content
39
+ // handler is registered first in the DI container. This causes the workflows content handler to be invoked last
40
+ // when content events are triggered, allowing it to access the final state of the content item after all other
41
+ // content handlers have executed. Note: handlers are resolved in reverse order, so setting this constant ensures
42
+ // this handler runs last during content item created, updated, etc. events.
43
+ public override int Order => OrchardCoreConstants . ConfigureOrder . WorkflowsContentHandlers ;
44
+
45
+ public override void ConfigureServices ( IServiceCollection services )
46
+ {
47
+ services . AddScoped < IContentHandler , ContentsHandler > ( ) ;
48
+ }
49
+ }
Original file line number Diff line number Diff line change @@ -76,6 +76,10 @@ public static class ConfigureOrder
76
76
77
77
// The UrlRewriting module should be registered before any other module that deals with URLs.
78
78
public const int UrlRewriting = InfrastructureService + 100 ;
79
+
80
+ // The Workflows content handler should be registered before other content handlers to ensure it
81
+ // processes content events last.
82
+ public const int WorkflowsContentHandlers = InfrastructureService + 100 ;
79
83
}
80
84
81
85
public static class DisplayType
You can’t perform that action at this time.
0 commit comments