mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#18783: Projection Widget was not displayed without a pager
The shape was null, which was not handled internally --HG-- branch : 1.x
This commit is contained in:
@@ -113,7 +113,15 @@ namespace Orchard.ContentManagement.Drivers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private ContentShapeResult ContentShapeImplementation(string shapeType, Func<BuildShapeContext, object> shapeBuilder) {
|
private ContentShapeResult ContentShapeImplementation(string shapeType, Func<BuildShapeContext, object> shapeBuilder) {
|
||||||
return new ContentShapeResult(shapeType, Prefix, ctx => AddAlternates(shapeBuilder(ctx), ctx));
|
return new ContentShapeResult(shapeType, Prefix, ctx => {
|
||||||
|
var shape = shapeBuilder(ctx);
|
||||||
|
|
||||||
|
if(shape == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AddAlternates(shape, ctx);;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static dynamic AddAlternates(dynamic shape, BuildShapeContext ctx) {
|
private static dynamic AddAlternates(dynamic shape, BuildShapeContext ctx) {
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ namespace Orchard.ContentManagement.Drivers {
|
|||||||
|
|
||||||
var newShape = _shapeBuilder(context);
|
var newShape = _shapeBuilder(context);
|
||||||
|
|
||||||
|
// ignore it if the driver returned a null shape
|
||||||
|
if(newShape == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// add a ContentPart property to the final shape
|
// add a ContentPart property to the final shape
|
||||||
if (ContentPart != null && newShape.ContentPart == null) {
|
if (ContentPart != null && newShape.ContentPart == null) {
|
||||||
newShape.ContentPart = ContentPart;
|
newShape.ContentPart = ContentPart;
|
||||||
|
|||||||
Reference in New Issue
Block a user