Fixing exception when importing Projection Elements with the default layout selected

Fixed the export of this previously, this was remaining.
This commit is contained in:
Lombiq
2015-09-08 01:01:23 +02:00
parent a685517118
commit 2a0f866f26

View File

@@ -307,10 +307,9 @@ namespace Orchard.Layouts.Drivers {
var queryPart = query.As<QueryPart>();
var layoutIndex = XmlHelper.Parse<int>(context.ExportableData.Get("LayoutIndex"));
var layout = queryPart.Layouts[layoutIndex];
element.QueryId = queryPart.Id;
element.LayoutId = layout.Id;
element.LayoutId = layoutIndex != -1 ? queryPart.Layouts[layoutIndex].Id : -1;
}
private static string GetLayoutDescription(IEnumerable<LayoutDescriptor> layouts, LayoutRecord l) {