#21101: Possible to publish multiple content items with same permalink

Work Item: 21101
This commit is contained in:
Katsuyuki Ohmuro
2015-02-01 15:23:27 +01:00
committed by agriffard
parent 12285abca8
commit c4348a1b21

View File

@@ -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<AutoroutePart, AutoroutePartRecord>().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}\"",