mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#19161: Fixing NRE when editing the placement for widgets
Work Item: 19161 --HG-- branch : 1.x
This commit is contained in:
@@ -144,9 +144,6 @@ namespace Orchard.ContentTypes.Controllers {
|
||||
if (contentTypeDefinition == null)
|
||||
return HttpNotFound();
|
||||
|
||||
var content = Services.ContentManager.New(id);
|
||||
var shape = Services.ContentManager.BuildEditor(content);
|
||||
|
||||
var placementModel = new EditPlacementViewModel {
|
||||
PlacementSettings = contentTypeDefinition.GetPlacement(PlacementType.Editor),
|
||||
AllPlacements = _placementService.GetEditorPlacement(id).OrderBy(x => x.PlacementSettings.Position, new FlatPositionComparer()).ThenBy(x => x.PlacementSettings.ShapeType).ToList(),
|
||||
|
@@ -24,7 +24,12 @@
|
||||
|
||||
<li data-shape-type="@placement.ShapeType" data-shape-differentiator="@placement.Differentiator" data-shape-zone="Content" data-shape-position="@placement.Position">
|
||||
<div class="shape-type"><h3>@placement.ShapeType @placement.Differentiator</h3></div>
|
||||
<div class="shape-editor">@Display(Model.AllPlacements[i].Shape)</div>
|
||||
@try {
|
||||
<div class="shape-editor">@Display(Model.AllPlacements[i].Shape)</div>
|
||||
}
|
||||
catch {
|
||||
}
|
||||
|
||||
@* @shape.Position @(Model.PlacementSettings.Any(x => x.Equals(shape)))*@
|
||||
@Html.HiddenFor(m => m.AllPlacements[i].PlacementSettings.ShapeType, new { @class = "type" })
|
||||
@Html.HiddenFor(m => m.AllPlacements[i].PlacementSettings.Differentiator, new { @class = "differentiator" })
|
||||
|
Reference in New Issue
Block a user