#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:
Sebastien Ros
2012-07-03 09:03:40 -07:00
parent 48263b19d2
commit 16216121c2
2 changed files with 14 additions and 1 deletions

View File

@@ -113,7 +113,15 @@ namespace Orchard.ContentManagement.Drivers {
}
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) {

View File

@@ -38,6 +38,11 @@ namespace Orchard.ContentManagement.Drivers {
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
if (ContentPart != null && newShape.ContentPart == null) {
newShape.ContentPart = ContentPart;