Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Cannot add module to a pageCannot add module to a page
Previous
 
Next
New Post
10/10/2011 7:05 AM
 
Hello all!

Can anybody advise about a rather long-standing problem I have had. I had a module that used to load OK back at around DNN 5.0, but since then I have never managed to be able to use it through subsequent upgrades. The symptoms are unfortunately very simple and stubborn, I just get the following error when I try to add the module to a page:

DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Entities.Modules.ModuleController.AddModule(ModuleInfo module) at DotNetNuke.UI.ControlPanels.ControlPanelBase.AddNewModule(String title, Int32 desktopModuleId, String paneName, Int32 position, ViewPermissionType permissionType, String align) at DotNetNuke.UI.ControlPanels.IconBar.AddModule_Click(Object sender, EventArgs e)

In an effort to troubleshoot the issue, I have now stripped back the module to simply a couple of blank ASCX controls with hardly any code behind in use. But the problem remains the same, which has started to make me think that perhaps there is some slight corruption of the database, with some sort of module definition problem. I have the module set up as a DLL compiled module, but the debugging for the module does not even get invoked, as if the DNN add module process is failing before it gets to any module code - I do not even think this would be running when the module is first added, and as I say, the module hasn't really got any code behind left at the moment, apart from a skeletal namespace and class definition and a few namespace imports.

Given that the problem occurs even if I let DNN create the module package and definitions itself, would you agree that this might sound like a database issue that DNN only notices when it tries to add a module? If so, what sort of thing should I be looking for? As you can tell I am now thoroughly stuck about how to proceed with this problem, I've run out of ideas. Can anybody help?

Regards

 
New Post
10/10/2011 8:43 AM
 
Check to make sure each module control has a control key defined. IIRC earlier versions of DNN didn't always need a key for "view" controls and again IIRC somewhere in the 5.x path this changed. It's possible that the installation manifest for your module is not defining the key. If you can identify which one is missing then you can repair the manifest to include it in installations going forward.


Steven Webster
Manager, Community Platform
F5 Networks, DevCentral
 
New Post
10/10/2011 8:46 AM
 
Are you able to install and add to a page other "core" modules. If the addition of other modules to a page are also failing with the same error then the issue is not specific to your custom module.

In addition to checking the above, make sure that your module's controls inherit from DotNetNuke.Entities.Modules.PortalModuleBase in their code files or code behinds.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
10/10/2011 9:27 AM
 
Hi guys

Thanks for getting back so quick, but I regret to say that I already checked all of those. I do have the control keys, I can add core modules (so is definitely just something to do with mine), and the code behind is inheriting as it should. That's why I've started wondering what sort of database problems might have the effect of interfering with AddModule(ModuleInfo module), but I guess you think this unlikely after all? I have a bad feeling I might have to try putting checkpoints into AddModule just to see where the trouble is with my module, but I've not attempted this before so I was hoping there might be an easier way.

Cheers

 
New Post
10/14/2011 9:07 AM
 
I still can't get this module to add to a page. Would somebody be so kind as to cast a glance over the module entry in my manifest. I can't see any obvious mistake myself, but just in case I am missing something obvious, here it is (the [..] names are changed to protect the guilty) ... 

       <component type="Module">
          <desktopModule>
            <moduleName>[MyOrg].[MyModuleName]</moduleName>
            <foldername>[MyDevFolder]/[MyModuleFolder]</foldername>
            <businessControllerClass />
            <supportedFeatures />
            <moduleDefinitions>
              <moduleDefinition>
                <friendlyName>My Friendly Name</friendlyName>
                <defaultCacheTime>0</defaultCacheTime>
                <moduleControls>
                  <moduleControl>
                    <controlKey>MyControlKeyView</controlKey>
                    <controlSrc>DesktopModules/[MyDevFolder]/[MyModuleFolder]/MyViewControl.ascx</controlSrc>
                    <supportsPartialRendering>False</supportsPartialRendering>
                    <controlTitle>My View Control</controlTitle>
                    <controlType>View</controlType>
                    <iconFile />
                    <helpUrl />
                    <supportsPopUps>False</supportsPopUps>
                    <viewOrder>0</viewOrder>
                  </moduleControl>
                  <moduleControl>
                    <controlKey>MyControlKeySettings</controlKey>
                    <controlSrc>DesktopModules/[MyDevFolder]/[MyModuleFolder]/MySettingsControl.ascx</controlSrc>
                    <supportsPartialRendering>False</supportsPartialRendering>
                    <controlTitle>My Settings Control</controlTitle>
                    <controlType>Edit</controlType>
                    <iconFile />
                    <helpUrl />
                    <supportsPopUps>False</supportsPopUps>
                    <viewOrder>0</viewOrder>
                  </moduleControl>
                </moduleControls>
              </moduleDefinition>
            </moduleDefinitions>
          </desktopModule>
        </component>

Thanks if you can shed some light on my problem.

Regards


 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Cannot add module to a pageCannot add module to a page


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out