Fixed an issue when changing the homepage.

This fixes an issue where the previous published homepage would not have its regenerated alias stored.
This commit is contained in:
Sipke Schoorstra
2015-07-20 20:56:37 +01:00
parent 1494aec836
commit 5d09053d30

View File

@@ -66,6 +66,10 @@ namespace Orchard.Autoroute.Handlers {
if (current != null) {
current.CustomPattern = String.Empty; // force the regeneration
current.DisplayAlias = _autorouteService.Value.GenerateAlias(current);
// we changed the alias of the previous homepage, so publish this change if the content item was published.
if(current.IsPublished())
_orchardServices.ContentManager.Publish(current.ContentItem);
}
_autorouteService.Value.PublishAlias(current);
}