Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error getting host tab URL #5052

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1405,9 +1405,9 @@ private string FriendlyUrlInternal(TabInfo tab, string path, string pageName, st
var localSettings = new FriendlyUrlSettings(portalId);

// Call GetFriendlyAlias to get the Alias part of the url
if (string.IsNullOrEmpty(portalAlias) && portalSettings != null)
if (string.IsNullOrEmpty(portalAlias) && portalSettings?.PortalAlias is IPortalAliasInfo portalSettingsAlias)
{
portalAlias = portalSettings.PortalAlias.HTTPAlias;
portalAlias = portalSettingsAlias.HttpAlias;
}

string friendlyPath = GetFriendlyAlias(
Expand Down
3 changes: 2 additions & 1 deletion DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace DotNetNuke.Modules.Admin.Modules

using DotNetNuke.Abstractions;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Host;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Definitions;
using DotNetNuke.Entities.Portals;
Expand Down Expand Up @@ -89,7 +90,7 @@ protected string GetInstalledOnLink(object dataItem)
{
var index = 0;
TabController.Instance.PopulateBreadCrumbs(ref tab);
var defaultAlias = PortalAliasController.Instance.GetPortalAliasesByPortalId(tab.PortalID)
var defaultAlias = PortalAliasController.Instance.GetPortalAliasesByPortalId(tab.IsSuperTab ? Host.HostPortalID : tab.PortalID)
.OrderByDescending(a => a.IsPrimary)
.FirstOrDefault();
var portalSettings = new PortalSettings(tab.PortalID)
Expand Down