fix logic issue in url mapping, improve 404 handling, add property change component notifications
This commit is contained in:
@ -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
|
||||
|
@ -390,6 +390,32 @@ namespace Oqtane.Repository
|
||||
}
|
||||
}
|
||||
});
|
||||
pageTemplates.Add(new PageTemplate
|
||||
{
|
||||
Name = "Not Found",
|
||||
Parent = "",
|
||||
Path = "404",
|
||||
Icon = Icons.X,
|
||||
IsNavigation = false,
|
||||
IsPersonalizable = false,
|
||||
PagePermissions = new List<Permission>
|
||||
{
|
||||
new Permission(PermissionNames.View, RoleNames.Everyone, true),
|
||||
new Permission(PermissionNames.View, RoleNames.Admin, true),
|
||||
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
|
||||
}.EncodePermissions(),
|
||||
PageTemplateModules = new List<PageTemplateModule>
|
||||
{
|
||||
new PageTemplateModule { ModuleDefinitionName = "Oqtane.Modules.HtmlText, Oqtane.Client", Title = "Not Found", Pane = PaneNames.Admin,
|
||||
ModulePermissions = new List<Permission> {
|
||||
new Permission(PermissionNames.View, RoleNames.Everyone, true),
|
||||
new Permission(PermissionNames.View, RoleNames.Admin, true),
|
||||
new Permission(PermissionNames.Edit, RoleNames.Admin, true)
|
||||
}.EncodePermissions(),
|
||||
Content = "<p>The page you requested does not exist.</p>"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// admin pages
|
||||
pageTemplates.Add(new PageTemplate
|
||||
|
Reference in New Issue
Block a user