mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#18524: Fixing cross requests pager parameters
Work Item: 18524 --HG-- branch : 1.x
This commit is contained in:
@@ -408,9 +408,6 @@ namespace Orchard.Core.Shapes {
|
|||||||
var lastText = LastText ?? T(">>");
|
var lastText = LastText ?? T(">>");
|
||||||
var gapText = GapText ?? T("...");
|
var gapText = GapText ?? T("...");
|
||||||
|
|
||||||
// workaround: get it from the shape instead of parameter
|
|
||||||
var RouteValues = (object)Shape.RouteValues;
|
|
||||||
|
|
||||||
var routeData = new RouteValueDictionary(Html.ViewContext.RouteData.Values);
|
var routeData = new RouteValueDictionary(Html.ViewContext.RouteData.Values);
|
||||||
var queryString = _workContext.Value.HttpContext.Request.QueryString;
|
var queryString = _workContext.Value.HttpContext.Request.QueryString;
|
||||||
if (queryString != null) {
|
if (queryString != null) {
|
||||||
@@ -419,15 +416,24 @@ namespace Orchard.Core.Shapes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Shape.RouteData != null) {
|
// specific cross-requests route data can be passed to the shape directly (e.g., Orchard.Users)
|
||||||
var shapeRouteData = Shape.RouteData is RouteValueDictionary ? (RouteValueDictionary) RouteValues : new RouteValueDictionary(RouteValues);
|
var shapeRoute = (object)Shape.RouteData;
|
||||||
foreach (var rd in shapeRouteData) {
|
|
||||||
shapeRouteData[rd.Key] = rd.Value;
|
if (shapeRoute != null) {
|
||||||
|
var shapeRouteData = shapeRoute as RouteValueDictionary;
|
||||||
|
if (shapeRouteData == null) {
|
||||||
|
var route = shapeRoute as RouteData;
|
||||||
|
if (route != null) {
|
||||||
|
shapeRouteData = (route).Values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (routeData.ContainsKey("id"))
|
if (shapeRouteData != null) {
|
||||||
// routeData.Remove("id");
|
foreach (var rd in shapeRouteData) {
|
||||||
|
routeData[rd.Key] = rd.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HACK: MVC 3 is adding a specific value in System.Web.Mvc.Html.ChildActionExtensions.ActionHelper
|
// HACK: MVC 3 is adding a specific value in System.Web.Mvc.Html.ChildActionExtensions.ActionHelper
|
||||||
// when a content item is set as home page, it is rendered by using Html.RenderAction, and the routeData is altered
|
// when a content item is set as home page, it is rendered by using Html.RenderAction, and the routeData is altered
|
||||||
|
|||||||
Reference in New Issue
Block a user