mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Fixing that Path Placement Matches couldn't be used for editor templates when being updated.
This commit is contained in:
@@ -95,7 +95,7 @@ namespace Orchard.Layouts.Services {
|
||||
// Adding an alternate for [Stereotype]_Edit__[ContentType] e.g. Content-Menu.Edit.
|
||||
((IShape)itemShape).Metadata.Alternates.Add(actualShapeType + "__" + content.ContentItem.ContentType);
|
||||
|
||||
var context = new UpdateEditorContext(itemShape, content, updater, groupInfoId, _shapeFactory, shapeTable);
|
||||
var context = new UpdateEditorContext(itemShape, content, updater, groupInfoId, _shapeFactory, shapeTable, GetPath());
|
||||
BindPlacement(context, null, stereotype);
|
||||
|
||||
return context;
|
||||
@@ -121,7 +121,7 @@ namespace Orchard.Layouts.Services {
|
||||
Stereotype = stereotype,
|
||||
DisplayType = displayType,
|
||||
Differentiator = differentiator,
|
||||
Path = VirtualPathUtility.AppendTrailingSlash(_virtualPathProvider.ToAppRelative(request.Path)) // get the current app-relative path, i.e. ~/my-blog/foo
|
||||
Path = GetPath()
|
||||
};
|
||||
|
||||
// define which location should be used if none placement is hit
|
||||
@@ -140,5 +140,12 @@ namespace Orchard.Layouts.Services {
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current app-relative path, i.e. ~/my-blog/foo.
|
||||
/// </summary>
|
||||
private string GetPath() {
|
||||
return VirtualPathUtility.AppendTrailingSlash(_virtualPathProvider.ToAppRelative(_requestContext.HttpContext.Request.Path));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user