Merge pull request #3242 from sbwalker/dev

retain querystring parameters on url mapping redirect
This commit is contained in:
Shaun Walker 2023-09-08 12:05:35 -04:00 committed by GitHub
commit 8c88cec863
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -146,6 +146,10 @@
{
editmode = false; // reset edit mode when navigating to different page
}
if (querystring.ContainsKey("edit") && querystring["edit"] == "true")
{
editmode = true; // querystring can set edit mode
}
// get user
if (PageState == null || refresh || PageState.Alias.SiteId != SiteState.Alias.SiteId)
@ -290,7 +294,7 @@
var urlMapping = await UrlMappingService.GetUrlMappingAsync(site.SiteId, route.PagePath);
if (urlMapping != null && !string.IsNullOrEmpty(urlMapping.MappedUrl))
{
var url = (urlMapping.MappedUrl.StartsWith("http")) ? urlMapping.MappedUrl : route.SiteUrl + "/" + urlMapping.MappedUrl;
var url = (urlMapping.MappedUrl.StartsWith("http")) ? urlMapping.MappedUrl : route.SiteUrl + "/" + urlMapping.MappedUrl + route.Query;
NavigationManager.NavigateTo(url, false);
}
else // not mapped

View File

@ -122,7 +122,7 @@ namespace Oqtane.Models
public string UrlParameters { get; set; }
/// <summary>
/// A route may contain querystring parameters located after the ? delimiter
/// All querystring parameters (prefixed with a ? delimiter)
/// </summary>
public string Query { get; set; }