mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 12:53:33 +08:00
Fixing an error wrt the home page being unpublished then published through some other means than the page edit UI resulting in a "404" error page
work item: 17003 --HG-- branch : dev
This commit is contained in:
@@ -52,12 +52,16 @@ namespace Orchard.Core.Routable.Handlers {
|
||||
Action<PublishContentContext, RoutePart> handler = (context, route) => {
|
||||
FinalizePath(route, context, processSlug);
|
||||
|
||||
if (route.Id != 0 && route.PromoteToHomePage && _routableHomePageProvider != null) {
|
||||
if (_routableHomePageProvider == null)
|
||||
return;
|
||||
|
||||
var homePageSetting = _workContextAccessor.GetContext().CurrentSite.HomePage;
|
||||
var currentHomePageId = !string.IsNullOrWhiteSpace(homePageSetting)
|
||||
? _routableHomePageProvider.GetHomePageId(homePageSetting)
|
||||
: 0;
|
||||
|
||||
if (route.Id != 0 && (route.Id == currentHomePageId || route.PromoteToHomePage)) {
|
||||
|
||||
if (currentHomePageId != route.Id) {
|
||||
// reset the path on the current home page
|
||||
var currentHomePage = _contentManager.Get(currentHomePageId);
|
||||
|
Reference in New Issue
Block a user