Backed out changeset: 2e961eac34d1

Was breaking a unit test and didn't cause any overhead

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2013-05-15 11:37:26 -07:00
parent 9f92036d68
commit f0b537e36c

View File

@@ -9,7 +9,6 @@ using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Security;
using Orchard.Services;
using Orchard.ContentManagement.MetaData.Models;
namespace Orchard.Core.Common.Handlers {
[UsedImplicitly]
@@ -64,12 +63,14 @@ namespace Orchard.Core.Common.Handlers {
public Localizer T { get; set; }
protected override void Activating(ActivatingContentContext context) {
if (ContentTypeWithACommonPart(context.Definition))
if (ContentTypeWithACommonPart(context.ContentType))
context.Builder.Weld<ContentPart<CommonPartVersionRecord>>();
}
protected bool ContentTypeWithACommonPart(ContentTypeDefinition contentTypeDefinition) {
protected bool ContentTypeWithACommonPart(string typeName) {
//Note: What about content type handlers which activate "CommonPart" in code?
var contentTypeDefinition = _contentDefinitionManager.GetTypeDefinition(typeName);
if (contentTypeDefinition != null)
return contentTypeDefinition.Parts.Any(part => part.PartDefinition.Name == "CommonPart");