mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-02 19:44:02 +08:00
#18749: Fixing content part based field alternates
Work Item: 18749 --HG-- branch : 1.x
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user