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

Raise minimum dnn support 9.11 #517

Open
wants to merge 25 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
515327f
Replaced DNN 9.8.0 DLLs with 9.11.00
alejoroman0605 Dec 16, 2024
4dcedce
Update DNN 9.8.0 DLLs with 9.11.00
alejoroman0605 Dec 16, 2024
9a582ca
Updated cms packages
alejoroman0605 Dec 16, 2024
679a51a
Updating WebDeploy files
alejoroman0605 Dec 16, 2024
997436e
Merge branch 'development' into raise-minimum-dnn-support-9.11
alejoroman0605 Dec 19, 2024
a9714f9
Changed PortalSecurity.FilterFlag.NoMarkup by WebUtility.HtmlEncode();
alejoroman0605 Dec 19, 2024
1636c26
Replacing EventLogController with IEventLogger
alejoroman0605 Dec 19, 2024
54c3d24
Update DnnEventLog.cs
alejoroman0605 Dec 19, 2024
787c423
Replaced HostController by IHostSettingsService
alejoroman0605 Dec 19, 2024
8409f16
Changed Globals by INavigationManager
alejoroman0605 Dec 19, 2024
3d10000
Update DnnAccountService.cs
alejoroman0605 Dec 19, 2024
dfb4a75
Update DnnGlobal.cs
alejoroman0605 Dec 19, 2024
f73b7d2
Changed Globals by IApplicationStatusInfo
alejoroman0605 Dec 19, 2024
f902008
Update Hotcakes.Commerce.Dnn.csproj
alejoroman0605 Dec 19, 2024
0f27ded
Update Hotcakes.Commerce.NoCms.csproj
alejoroman0605 Dec 19, 2024
71639fd
Update CultureSwitch.cs
alejoroman0605 Dec 19, 2024
52e195c
Update RewriterUtils.cs
alejoroman0605 Dec 19, 2024
37ef637
Changed HostController.Instance by IHostSettingsService
alejoroman0605 Dec 19, 2024
3c0d633
Update Hotcakes.Commerce.Dnn.csproj
alejoroman0605 Dec 19, 2024
ed23dea
Update DnnLocalizationHelper.cs
alejoroman0605 Dec 19, 2024
af0d404
Update HccFriendlyUrlProvider.cs
alejoroman0605 Dec 19, 2024
b030d1d
Update PageUtils.cs
alejoroman0605 Dec 19, 2024
032a29e
Changed PortalInfo by IPortalInfo
alejoroman0605 Dec 19, 2024
484fe76
Repalced Globals by INavigationManager
alejoroman0605 Dec 19, 2024
62dc3f5
Lowered version of Microsoft.Extensions.DependencyInjection.Abstracti…
alejoroman0605 Dec 20, 2024
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
12 changes: 12 additions & 0 deletions Libraries/Hotcakes.Commerce.Dnn/App.Config
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@
<assemblyIdentity name="System.Web.WebPages.Deployment" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.DependencyInjection.Abstractions" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Bcl.AsyncInterfaces" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup></configuration>
10 changes: 7 additions & 3 deletions Libraries/Hotcakes.Commerce.Dnn/DnnAccountService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,25 @@
#endregion

using System;
using DotNetNuke.Abstractions.Portals;
using DotNetNuke.Application;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Services.Analytics.Config;
using Hotcakes.Commerce.Accounts;
using Microsoft.Extensions.DependencyInjection;

namespace Hotcakes.Commerce.Dnn
{
[Serializable]
public class DnnAccountService : AccountService
{
#region Constructor

private readonly IPortalAliasService _portalAliasService;
public DnnAccountService(HccRequestContext context)
: base(context)
{
_portalAliasService = DependencyProvider.GetRequiredService<IPortalAliasService>();
}

#endregion
Expand All @@ -57,11 +61,11 @@ public PortalSettings CurrentPortalSettings

public override Store GetStoreByUrl(string url)
{
var aliasInfo = PortalAliasController.Instance.GetPortalAlias(url);
var aliasInfo = _portalAliasService.GetPortalAlias(url);
if (aliasInfo != null)
{
var portalController = new PortalController();
var portalInfo = portalController.GetPortal(aliasInfo.PortalID);
var portalInfo = portalController.GetPortal(aliasInfo.PortalId);
if (portalInfo != null)
{
return Stores.FindByStoreGuid(portalInfo.GUID);
Expand Down
38 changes: 22 additions & 16 deletions Libraries/Hotcakes.Commerce.Dnn/DnnEventLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,31 @@
#endregion

using System;
using DotNetNuke.Abstractions.Logging;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.Log.EventLog;
using Hotcakes.Web.Logging;
using Microsoft.Extensions.DependencyInjection;

namespace Hotcakes.Commerce.Dnn
{
[Serializable]
public class DnnEventLog : ILogger
public class DnnEventLog : PortalModuleBase, ILogger
{
private const string LOGTYPE_MESSAGE = "HOTCAKES_INFO";
private const string LOGTYPE_EXCEPTION = "HOTCAKES_EXCEPTION";
private readonly IEventLogger eventLogger;
private readonly LogInfo LogInfo;
private ILogInfo logInfo => LogInfo;

public DnnEventLog()
{
eventLogger = DependencyProvider.GetRequiredService<IEventLogger>();
LogInfo = new LogInfo();
}

public void LogMessage(string message)
{
Expand All @@ -50,27 +62,23 @@ public void LogException(Exception ex)

public void LogMessage(string source, string message, EventLogSeverity severity)
{
var logInfo = new LogInfo();
var user = DnnUserController.Instance.GetCurrentUserInfo();

logInfo.LogUserID = user != null ? user.UserID : -1;
logInfo.LogPortalID = PortalSettings.Current != null ? PortalSettings.Current.PortalId : -1;
logInfo.LogUserId = user != null ? user.UserID : -1;
logInfo.LogPortalId = PortalSettings.Current != null ? PortalSettings.Current.PortalId : -1;
logInfo.LogTypeKey = LOGTYPE_MESSAGE;
logInfo.AddProperty("Severity", severity.ToString());
logInfo.LogProperties.Add(new LogDetailInfo("Source", source));
logInfo.LogProperties.Add(new LogDetailInfo("Message", message));

var log = new EventLogController();
log.AddLog(logInfo);
eventLogger.AddLog(logInfo);
}

public void LogException(Exception ex, EventLogSeverity severity)
{
var logInfo = new LogInfo();
var user = DnnUserController.Instance.GetCurrentUserInfo();

logInfo.LogUserID = user != null ? user.UserID : -1;
logInfo.LogPortalID = DnnGlobal.Instance.GetPortalId();
logInfo.LogUserId = user != null ? user.UserID : -1;
logInfo.LogPortalId = DnnGlobal.Instance.GetPortalId();
logInfo.LogTypeKey = LOGTYPE_EXCEPTION;
logInfo.AddProperty("Severity", severity.ToString());

Expand All @@ -97,8 +105,7 @@ public void LogException(Exception ex, EventLogSeverity severity)
logInfo.LogProperties.Add(new LogDetailInfo("Message", exception4.Message));
logInfo.LogProperties.Add(new LogDetailInfo("Source", exception4.Source));

var log = new EventLogController();
log.AddLog(logInfo);
eventLogger.AddLog(logInfo);
}

public static void InstallLogTypes()
Expand All @@ -117,7 +124,7 @@ private static void RegisterLogType(string logTypeKey, string logTypeFriendlyNam
var logTypeInfo = controller.GetLogTypeInfoDictionary()[logTypeKey];
logTypeInfo.LogTypeFriendlyName = logTypeFriendlyName;
logTypeInfo.LogTypeDescription = string.Empty;
logTypeInfo.LogTypeCSSClass = cssClass;
((ILogTypeInfo)logTypeInfo).LogTypeCssClass = cssClass;
logTypeInfo.LogTypeOwner = "Hotcakes.Logging.EventLogType";
controller.UpdateLogType(logTypeInfo);
}
Expand All @@ -129,9 +136,9 @@ private static void RegisterLogType(string logTypeKey, string logTypeFriendlyNam
LogTypeKey = logTypeKey,
LogTypeFriendlyName = logTypeFriendlyName,
LogTypeDescription = string.Empty,
LogTypeCSSClass = cssClass,
LogTypeOwner = "Hotcakes.Logging.EventLogType"
};
((ILogTypeInfo)logTypeInfo).LogTypeCssClass = cssClass;
controller.AddLogType(logTypeInfo);

//Add LogType
Expand All @@ -145,9 +152,8 @@ private static void RegisterLogType(string logTypeKey, string logTypeFriendlyNam
NotificationThresholdTimeType = LogTypeConfigInfo.NotificationThresholdTimeTypes.Seconds,
MailFromAddress = Null.NullString,
MailToAddress = Null.NullString,
LogTypePortalID = "*"
};

((ILogTypeConfigInfo)logTypeConf).LogTypePortalId = "*";
controller.AddLogTypeConfigInfo(logTypeConf);
}
}
Expand Down
3 changes: 2 additions & 1 deletion Libraries/Hotcakes.Commerce.Dnn/DnnGlobal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using DotNetNuke.Abstractions.Portals;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Data;
using DotNetNuke.Entities.Portals;
Expand Down Expand Up @@ -109,7 +110,7 @@ public Locale GetLocale(string code)
public CultureInfo GetPageLocale()
{
var portalSettings = Instance.GetCurrentPortalSettings();
return Localization.GetPageLocale(portalSettings);
return Localization.GetPageLocale((IPortalSettings)portalSettings);
}
}
}
Expand Down
14 changes: 12 additions & 2 deletions Libraries/Hotcakes.Commerce.Dnn/DnnHostSettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,24 @@

using System;
using System.Collections.Generic;
using DotNetNuke.Abstractions.Application;
using DotNetNuke.Entities.Controllers;
using DotNetNuke.Entities.Host;
using DotNetNuke.Entities.Modules;
using Microsoft.Extensions.DependencyInjection;

namespace Hotcakes.Commerce.Dnn
{
[Serializable]
public class DnnHostSettingsProvider : IHostSettingsProvider
public class DnnHostSettingsProvider : PortalModuleBase, IHostSettingsProvider
{
private readonly IHostSettingsService _hostSettingsService;

public DnnHostSettingsProvider()
{
_hostSettingsService = DependencyProvider.GetRequiredService<IHostSettingsService>();
}

public IEnumerable<string> GetAllowedExtensions()
{
return Host.AllowedExtensionWhitelist.AllowedExtensions;
Expand Down Expand Up @@ -66,7 +76,7 @@ public T GetSettingValue<T>(string key, T defVal)

protected object GetSettingValue(string key)
{
return HostController.Instance.GetString(key);
return _hostSettingsService.GetString(key);
}
}
}
15 changes: 10 additions & 5 deletions Libraries/Hotcakes.Commerce.Dnn/DnnLocalizationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,30 @@
using System.Threading;
using System.Web.Hosting;
using System.Xml.XPath;
using DotNetNuke.Abstractions;
using DotNetNuke.Abstractions.Application;
using DotNetNuke.Collections.Internal;
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Portals;
using DotNetNuke.Instrumentation;
using DotNetNuke.Services.Cache;
using DotNetNuke.Services.Localization;
using Hotcakes.Commerce.Globalization;
using Microsoft.Extensions.DependencyInjection;

namespace Hotcakes.Commerce.Dnn
{
[Serializable]
public class DnnLocalizationHelper : ILocalizationHelper
public class DnnLocalizationHelper : PortalModuleBase, ILocalizationHelper
{
private readonly string _resourceFile;

private readonly IApplicationStatusInfo _applicationStatusInfo;
public DnnLocalizationHelper(string resourcefile)
{
_resourceFile = resourcefile;
_applicationStatusInfo = DependencyProvider.GetRequiredService<IApplicationStatusInfo>();
}

public string GetString(string key)
Expand Down Expand Up @@ -133,7 +138,7 @@ private Dictionary<string, string> GetResourceDictionary(string resourceFileRoot
Locale userLocale = null;
try
{
if (Globals.Status != Globals.UpgradeStatus.Install)
if (_applicationStatusInfo.Status != UpgradeStatus.Install)
{
//Get Fallback language, but not when we are installing (because we may not have a database yet)
userLocale = LocaleController.Instance.GetLocale(userLanguage);
Expand Down Expand Up @@ -407,7 +412,7 @@ private static bool TryGetFromResourceFile(string key, string resourceFile, int
return bFound;
}

private static bool TryGetStringInternal(string key, string userLanguage, string resourceFile,
private bool TryGetStringInternal(string key, string userLanguage, string resourceFile,
PortalSettings portalSettings, ref string resourceValue)
{
var defaultLanguage = Null.NullString;
Expand Down Expand Up @@ -435,7 +440,7 @@ private static bool TryGetStringInternal(string key, string userLanguage, string
Locale userLocale = null;
try
{
if (Globals.Status != Globals.UpgradeStatus.Install)
if (_applicationStatusInfo.Status != UpgradeStatus.Install)
{
//Get Fallback language, but not when we are installing (because we may not have a database yet)
userLocale = LocaleController.Instance.GetLocale(userLanguage);
Expand Down
14 changes: 11 additions & 3 deletions Libraries/Hotcakes.Commerce.Dnn/DnnStoreSettingsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,22 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using DotNetNuke.Entities.Controllers;
using DotNetNuke.Abstractions.Application;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Localization;
using Microsoft.Extensions.DependencyInjection;

namespace Hotcakes.Commerce.Dnn
{
[Serializable]
public class DnnStoreSettingsProvider : IStoreSettingsProvider
public class DnnStoreSettingsProvider : PortalModuleBase, IStoreSettingsProvider
{
private readonly IHostSettingsService _hostSettingsService;

public DnnStoreSettingsProvider()
{
_hostSettingsService = DependencyProvider.GetRequiredService<IHostSettingsService>();
}
public T GetSettingValue<T>(string key, T defVal)
{
var val = GetSettingValue(key);
Expand Down Expand Up @@ -85,7 +93,7 @@ public string GetDefaultLocale()

protected object GetSettingValue(string key)
{
return HostController.Instance.GetString(key);
return _hostSettingsService.GetString(key);
}

protected HccLocale ConvertLocale(Locale locale)
Expand Down
Loading