From 0acd1f3e915fad584f136379f87e02cda7aa11de Mon Sep 17 00:00:00 2001 From: Sebastien Ros Date: Fri, 16 Jul 2010 17:27:01 -0700 Subject: [PATCH] Corrected unique slugs management - Two different blogs can have a blog post with the same slug - Other routable items can have the same slug if hte whole path is unique (e.g. Page) --HG-- branch : dev --- src/Orchard.Web/Core/Routable/Services/RoutableService.cs | 4 ++-- .../Views/DisplayTemplates/Items/Blogs.Blog.SummaryAdmin.ascx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Orchard.Web/Core/Routable/Services/RoutableService.cs b/src/Orchard.Web/Core/Routable/Services/RoutableService.cs index 3b533b0c7..69a3fe436 100644 --- a/src/Orchard.Web/Core/Routable/Services/RoutableService.cs +++ b/src/Orchard.Web/Core/Routable/Services/RoutableService.cs @@ -66,7 +66,7 @@ namespace Orchard.Core.Routable.Services { _contentManager.Query(contentType).Join() .List() .Select(i => i.As()) - .Where(routable => routable.Slug.StartsWith(slug, StringComparison.OrdinalIgnoreCase)) // todo: for some reason the filter doesn't work within the query, even without StringComparison or StartsWith + .Where(routable => routable.Path.Equals(slug, StringComparison.OrdinalIgnoreCase)) // todo: for some reason the filter doesn't work within the query, even without StringComparison or StartsWith .ToArray(); } @@ -84,7 +84,7 @@ namespace Orchard.Core.Routable.Services { return true; } - var slugsLikeThis = GetSimilarSlugs(part.ContentItem.ContentType, part.Slug); + var slugsLikeThis = GetSimilarSlugs(part.ContentItem.ContentType, part.Path); // If the part is already a valid content item, don't include it in the list // of slug to consider for conflict detection diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/DisplayTemplates/Items/Blogs.Blog.SummaryAdmin.ascx b/src/Orchard.Web/Modules/Orchard.Blogs/Views/DisplayTemplates/Items/Blogs.Blog.SummaryAdmin.ascx index 172d59027..ab489f33d 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/DisplayTemplates/Items/Blogs.Blog.SummaryAdmin.ascx +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/DisplayTemplates/Items/Blogs.Blog.SummaryAdmin.ascx @@ -5,9 +5,9 @@