Introduce IHostSettings to replace Host class#6538
Introduce IHostSettings to replace Host class#6538david-poindexter merged 15 commits intodnnsoftware:developfrom
Conversation
valadas
left a comment
There was a problem hiding this comment.
Posted a few questions...
DNN Platform/DotNetNuke.Abstractions/Application/IHostSettings.cs
Outdated
Show resolved
Hide resolved
DNN Platform/DotNetNuke.Abstractions/Application/IHostSettings.cs
Outdated
Show resolved
Hide resolved
a794088 to
6a18504
Compare
|
I've pushed resolutions to all of your questions @valadas |
valadas
left a comment
There was a problem hiding this comment.
Cought 2 more little fallbacks missing and one more question, but looks great!
DNN Platform/Website/DesktopModules/Admin/Security/User.ascx.cs
Outdated
Show resolved
Hide resolved
eb5868d to
4cdb886
Compare
valadas
left a comment
There was a problem hiding this comment.
Nothing sticks out from the code however when I run DNN from this CI build I get the following error in Pages and Theme (persona bar modules)
2025-05-06 13:29:37.491-04:00 [DanielValadasPC][D:6][T:35][ERROR] DotNetNuke.Services.Exceptions.Exceptions - System.NullReferenceException: Object reference not set to an instance of an object.
at DotNetNuke.UI.Skins.SkinController.CanDeleteSkin(IHostSettings hostSettings, String folderPath, String portalHomeDirMapPath)
at Dnn.PersonaBar.Themes.Components.ThemesController.GetThemes(ThemeType type, String strRoot)
at Dnn.PersonaBar.Themes.Components.ThemesController.GetLayouts(PortalSettings portalSettings, ThemeLevel level)
at Dnn.PersonaBar.Themes.Components.ThemesController.GetThemeFile(PortalSettings portalSettings, String filePath, ThemeType type)
at Dnn.PersonaBar.Pages.Components.Converters.ConvertToPageSettings[T](TabInfo tab)
at Dnn.PersonaBar.Pages.Components.PagesControllerImpl.GetPageSettings(Int32 pageId, PortalSettings requestPortalSettings)
at Dnn.PersonaBar.Pages.Services.PagesController.GetPageDetails(Int32 pageId)
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_0.<GetExecutor>b__2(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()
|
I found the issue (a missed |
You are welcome, thanks for doing lol... |
Just retested, looks like it worked for the Pages module but not the Themes module |
|
It may however be a different issue, I see nothing in the log4net logs and I get this in the browswer: |
|
Also in the extensions module I get |
I just pushed a fix for the Themes extension (which was trying to use |
I made a small change to |
|
I've fixed |
GerardSmit
left a comment
There was a problem hiding this comment.
I saw this PR and had some small feedback/questions 😊
DNN Platform/DotNetNuke.Abstractions/Application/IHostSettings.cs
Outdated
Show resolved
Hide resolved
DNN Platform/DotNetNuke.Abstractions/Application/IHostSettings.cs
Outdated
Show resolved
Hide resolved
valadas
left a comment
There was a problem hiding this comment.
Nothing sticks out to me anymore, looks great! I tested a clean install and all the PB modules appear to be showing the right info. Nice!
Due to change from 0fe4a53
Replace static dependencies from JavaScript class
Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Components/Prompt/Models/HostModel.cs Dnn.AdminExperience/Dnn.PersonaBar.Extensions/Services/ThemesController.cs

Summary
In order to resolve usages of the deprecated
HostController.InstanceinDotNetNuke.Entities.Host.Host, this PR introducesDotNetNuke.Abstractions.Application.IHostSettingsand its default implementationDotNetNuke.Entities.Host.HostSettings. This included creating a copy of thePerformanceSettingsandSchedulerModeenums insideDotNetNuke.Abstractions, as well as extractingIFileExtensionAllowListfrom theFileExtensionWhitelistclass.IHostSettingsdiffers from the oldHostclass in a few ways.portalIdparameter, rather than implicitly using the current portal context.inttoTimeSpanto make date math easier and less error prone.Guidinstead ofGUID,HostPortalIdinstead ofHostPortalID)