mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
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:
@@ -66,6 +66,10 @@ namespace Orchard.Autoroute.Handlers {
|
|||||||
if (current != null) {
|
if (current != null) {
|
||||||
current.CustomPattern = String.Empty; // force the regeneration
|
current.CustomPattern = String.Empty; // force the regeneration
|
||||||
current.DisplayAlias = _autorouteService.Value.GenerateAlias(current);
|
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);
|
_autorouteService.Value.PublishAlias(current);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user