#18749: Fixing content part based field alternates

Work Item: 18749

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-06-25 12:44:23 -07:00
parent 14602cf274
commit 185ed552b0
3 changed files with 6 additions and 1 deletions

View File

@@ -148,7 +148,7 @@ namespace Orchard.ContentManagement.Drivers {
var shapeType = metadata.Type;
var fieldName = differentiator ?? String.Empty;
string partName = shape.ContentPart.PartDefinition.Name;
string partName = ctx.ContentPart.PartDefinition.Name;
string contentType = shape.ContentItem.ContentType;
// whether the content type has been created dynamically or not

View File

@@ -34,12 +34,16 @@ namespace Orchard.ContentManagement.Drivers {
return;
dynamic parentShape = context.Shape;
context.ContentPart = ContentPart;
var newShape = _shapeBuilder(context);
// add a ContentPart property to the final shape
if (ContentPart != null && newShape.ContentPart == null) {
newShape.ContentPart = ContentPart;
}
// add a ContentField property to the final shape
if (ContentField != null && newShape.ContentField == null) {
newShape.ContentField = ContentField;
}

View File

@@ -18,6 +18,7 @@ namespace Orchard.ContentManagement.Handlers {
public ContentItem ContentItem { get; private set; }
public dynamic New { get; private set; }
public string GroupId { get; private set; }
public ContentPart ContentPart { get; set; }
public Func<string, string, string, PlacementInfo> FindPlacement { get; set; }
}