From aa7360b94e24a67435cb95bd4f33d05485ceb113 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Sat, 30 Jun 2012 11:13:50 -0700 Subject: [PATCH] #18720: Fixing shape tracing issue with Projection pager Work Item: 18720 --HG-- branch : 1.x --- .hgsubstate | 2 +- src/Orchard.Web/Core/Shapes/CoreShapes.cs | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.hgsubstate b/.hgsubstate index c594f075d..2e6ac73ad 100644 --- a/.hgsubstate +++ b/.hgsubstate @@ -8,5 +8,5 @@ c77d9dafaa25a31b302877282a169cb9a0dd06b8 src/Orchard.Web/Modules/Orchard.Rules 419399ef2e37122a000e6cc8674148d3183d7032 src/Orchard.Web/Modules/Orchard.TaskLease 0c67b238df7d3758c30ce43b6293d85b1cc18e9a src/Orchard.Web/Modules/Orchard.Tokens 67dfa347443abf0b9cd266250bdeb97a6a12717e src/orchard.web/Modules/Orchard.Alias -3965133f9a0cb060be8414b215ae7c867889a276 src/orchard.web/Modules/Orchard.Projections +13f5f86332a11060323f93ca8d06b1414c7706ed src/orchard.web/Modules/Orchard.Projections aefccf4a2bc96af34bde4b9f86fd62d0523cf40f src/orchard.web/modules/Orchard.Fields diff --git a/src/Orchard.Web/Core/Shapes/CoreShapes.cs b/src/Orchard.Web/Core/Shapes/CoreShapes.cs index b5b31371f..730bb087f 100644 --- a/src/Orchard.Web/Core/Shapes/CoreShapes.cs +++ b/src/Orchard.Web/Core/Shapes/CoreShapes.cs @@ -562,10 +562,18 @@ namespace Orchard.Core.Shapes { } [Shape] - public IHtmlString Pager_Link(dynamic Shape, dynamic Display) { - Shape.Metadata.Alternates.Clear(); - Shape.Metadata.Type = "ActionLink"; - return Display(Shape); + public IHtmlString Pager_Link(HtmlHelper Html, dynamic Shape, dynamic Display, object Value) { + var RouteValues = (object)Shape.RouteValues; + RouteValueDictionary rvd; + if (RouteValues == null) { + rvd = new RouteValueDictionary(); + } + else { + rvd = RouteValues is RouteValueDictionary ? (RouteValueDictionary)RouteValues : new RouteValueDictionary(RouteValues); + } + + string value = Html.Encode(Value is string ? (string)Value : Display(Value)); + return @Html.ActionLink(value, (string)rvd["action"], (string)rvd["controller"], rvd, null); } [Shape]