#19493: Adding where clause to exlucde current part from being part of currentHomePages.

Work Item: 19493

--HG--
branch : 1.x
This commit is contained in:
Sipke Schoorstra
2013-03-01 19:00:08 +01:00
parent be2305a5f0
commit 90c1f0f985

View File

@@ -1,4 +1,5 @@
using System;
using System.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Autoroute.Models;
@@ -61,7 +62,7 @@ namespace Orchard.Autoroute.Handlers {
// regenerate the alias for the previous home page
var currentHomePages = _orchardServices.ContentManager.Query<AutoroutePart, AutoroutePartRecord>().Where(x => x.DisplayAlias == "").List();
foreach (var current in currentHomePages) {
foreach (var current in currentHomePages.Where(x => x.Id != part.Id)) {
if (current != null) {
current.CustomPattern = String.Empty; // force the regeneration
current.DisplayAlias = _autorouteService.Value.GenerateAlias(current);