mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 03:25:23 +08:00
Changing how the versioned compliment to the CommonPart is welded to the content type in question so as to not have potentially odd problems with an ActivatingFilter applied CommonPart
--HG-- branch : dev
This commit is contained in:
@@ -35,8 +35,6 @@ namespace Orchard.Core.Common.Handlers {
|
||||
Filters.Add(StorageFilter.For(commonRepository));
|
||||
Filters.Add(StorageFilter.For(commonVersionRepository));
|
||||
|
||||
Filters.Add(new ActivatingFilter<ContentPart<CommonPartVersionRecord>>(ContentTypeWithACommonPart));
|
||||
|
||||
OnInitializing<CommonPart>(PropertySetHandlers);
|
||||
OnInitializing<CommonPart>(AssignCreatingOwner);
|
||||
OnInitializing<CommonPart>(AssignCreatingDates);
|
||||
@@ -61,6 +59,11 @@ namespace Orchard.Core.Common.Handlers {
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
protected override void Activating(ActivatingContentContext context) {
|
||||
if (ContentTypeWithACommonPart(context.ContentType))
|
||||
context.Builder.Weld<ContentPart<CommonPartVersionRecord>>();
|
||||
}
|
||||
|
||||
bool ContentTypeWithACommonPart(string typeName) {
|
||||
//Note: What about content type handlers which activate "CommonPart" in code?
|
||||
var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(typeName);
|
||||
|
Reference in New Issue
Block a user