mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#21101: Possible to publish multiple content items with same permalink
Work Item: 21101
This commit is contained in:
committed by
agriffard
parent
12285abca8
commit
c4348a1b21
@@ -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}\"",
|
||||
|
||||
Reference in New Issue
Block a user