5 years ago,
Your question has been submitted and is awaiting moderation.
this is my scenario:
My site has an admin area through which the following procedure can be triggered manually:
It reads data from an external database and creates a new tab for each data entry.
This is a normal module inheriting from "PortalModuleBase".
I am trying to convert this to an automated scheduled DNN which runs daily.
As this is inheriting from "SchedulerClient" and not from "PortalModuleBase" I had to change certain aspects of the code (like "PortalSettings.HomeDirectoryMapPath" to "new PortalSettings(0).HomeDirectoryMapPath").
No compilation errors but during debugging whenever a TabInfo object gets created, I can see (by hovering over the object) that the attribute "FullUrl" always throws this error:
'tabInfo.FullUrl' threw an exception of type 'System.NullReferenceException'
All other attributes are ok.
The code executes until
RibbonBarManager.InitTabInfoObject() gets called and it fails with this error message:
System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Web.UI.RibbonBarManager.InitTabInfoObject(TabInfo relativeToTab, TabRelativeLocation location)
Looking at the the core source code I can see that "PortalSettings.Current" gets used to retrieve the FullUrl. And this is not valid within the SchedulerClient context.
Has anyone experienced the same? Can anyone help? Is there a work-around?