From 2308c66d078a101814d6f3fc93f2427335531f42 Mon Sep 17 00:00:00 2001 From: Brian Dukes Date: Thu, 17 Mar 2022 13:50:47 -0500 Subject: [PATCH] Fix error getting host tab URL Closes #5051 --- .../Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs | 4 ++-- DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs index 06475684a6a..9d5b908cda8 100644 --- a/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs +++ b/DNN Platform/Library/Entities/Urls/AdvancedFriendlyUrlProvider.cs @@ -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( diff --git a/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs b/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs index 479b273c768..2ad7bc9afac 100644 --- a/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs +++ b/DNN Platform/Website/admin/Modules/Modulesettings.ascx.cs @@ -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; @@ -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)