From 9ba008ec32876b1780044a298178b98ee5d5cf22 Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Fri, 24 Feb 2012 13:01:54 -0800 Subject: [PATCH] Backed out changeset: d566877ae7c9 --HG-- branch : 1.x --- .../Controllers/BlogController.cs | 12 +++------- .../Orchard.Blogs/Handlers/BlogPartHandler.cs | 2 +- .../Modules/Orchard.Blogs/Routes.cs | 22 +------------------ 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs index 088afe2c6..5d383ed15 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Controllers/BlogController.cs @@ -58,19 +58,13 @@ namespace Orchard.Blogs.Controllers { return View((object)viewModel); } - public ActionResult Item(string blogPath, PagerParameters pagerParameters) { + public ActionResult Item(int blogId, PagerParameters pagerParameters) { Pager pager = new Pager(_siteService.GetSiteSettings(), pagerParameters); - var correctedPath = _blogPathConstraint.FindPath(blogPath); - if (correctedPath == null) + var blogPart = _blogService.Get(blogId, VersionOptions.Published).As(); + if (blogPart == null) return HttpNotFound(); - var blogPart = _blogService.Get(correctedPath); - - //var blogPart = _blogService.Get(blogId, VersionOptions.Published).As(); - //if (blogPart == null) - // return HttpNotFound(); - _feedManager.Register(blogPart); var blogPosts = _blogPostService.Get(blogPart, pager.GetStartIndex(), pager.PageSize) .Select(b => _services.ContentManager.BuildDisplay(b, "Summary")); diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartHandler.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartHandler.cs index 02c597776..1f19d71cb 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Handlers/BlogPartHandler.cs @@ -35,7 +35,7 @@ namespace Orchard.Blogs.Handlers { {"Area", "Orchard.Blogs"}, {"Controller", "Blog"}, {"Action", "Item"}, - {"blogPath", context.ContentItem.As().Path} + {"blogId", context.ContentItem.Id} }; context.Metadata.CreateRouteValues = new RouteValueDictionary { {"Area", "Orchard.Blogs"}, diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Routes.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Routes.cs index 2cc854004..3883676a3 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Routes.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Routes.cs @@ -6,15 +6,12 @@ using Orchard.Mvc.Routes; namespace Orchard.Blogs { public class Routes : IRouteProvider { - private readonly IBlogPathConstraint _blogPathConstraint; private readonly IArchiveConstraint _archiveConstraint; private readonly IRsdConstraint _rsdConstraint; public Routes( - IBlogPathConstraint blogPathConstraint, IArchiveConstraint archiveConstraint, IRsdConstraint rsdConstraint) { - _blogPathConstraint = blogPathConstraint; _archiveConstraint = archiveConstraint; _rsdConstraint = rsdConstraint; } @@ -180,24 +177,7 @@ namespace Orchard.Blogs { }, new MvcRouteHandler()) }, - new RouteDescriptor { - Priority = 11, - Route = new Route( - "{*blogPath}", - new RouteValueDictionary { - {"area", "Orchard.Blogs"}, - {"controller", "Blog"}, - {"action", "Item"}, - }, - new RouteValueDictionary { - {"blogPath", _blogPathConstraint} - }, - new RouteValueDictionary { - {"area", "Orchard.Blogs"} - }, - new MvcRouteHandler()) - }, - new RouteDescriptor { + new RouteDescriptor { Route = new Route( "{*path}", new RouteValueDictionary {