fix logic issue in url mapping, improve 404 handling, add property change component notifications

This commit is contained in:
Shaun Walker
2022-04-04 17:16:12 -04:00
parent 683ad8959a
commit 042083c0e7
5 changed files with 149 additions and 4 deletions

View File

@ -153,7 +153,7 @@ namespace Oqtane.Pages
}
var page = _pages.GetPage(route.PagePath, site.SiteId);
if (page != null & !page.IsDeleted)
if (page != null && !page.IsDeleted)
{
// set page title
if (!string.IsNullOrEmpty(page.Title))
@ -182,6 +182,14 @@ namespace Oqtane.Pages
url = (urlMapping.MappedUrl.StartsWith("http")) ? urlMapping.MappedUrl : route.SiteUrl + "/" + urlMapping.MappedUrl;
return RedirectPermanent(url);
}
else
{
if (route.PagePath != "404")
{
_logger.Log(LogLevel.Information, "Host", LogFunction.Other, "Page Path /{Path} Does Not Exist", route.PagePath);
return RedirectPermanent(route.SiteUrl + "/404");
}
}
}
// include global resources