From c4348a1b21986c12ed5b7708a09e09a125936f0f Mon Sep 17 00:00:00 2001 From: Katsuyuki Ohmuro Date: Sun, 1 Feb 2015 15:23:27 +0100 Subject: [PATCH] #21101: Possible to publish multiple content items with same permalink Work Item: 21101 --- .../Orchard.Autoroute/Handlers/AutoroutePartHandler.cs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs b/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs index d7cbf14ea..ef3e8ca14 100644 --- a/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Autoroute/Handlers/AutoroutePartHandler.cs @@ -87,14 +87,8 @@ namespace Orchard.Autoroute.Handlers { return; } - // should it become the home page ? - if (part.DisplayAlias != "/" && _orchardServices.Authorizer.Authorize(Permissions.SetHomePage)) { - // if it's the current home page, do nothing - var currentHomePages = _orchardServices.ContentManager.Query().Where(x => x.DisplayAlias == "").List(); - if (currentHomePages.Any(x => x.Id == part.Id)) { - return; - } - + // check for permalink conflict, unless we are trying to set the home page + if (part.DisplayAlias != "/") { var previous = part.Path; if (!_autorouteService.Value.ProcessPath(part)) _orchardServices.Notifier.Warning(T("Permalinks in conflict. \"{0}\" is already set for a previously created {2} so now it has the slug \"{1}\"",