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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help PleaseHelp Please
Previous
 
Next
New Post
1/22/2007 5:18 PM
 


Hi I'm having this problem and I have no more ideias how to solve it.


Error: Module is currently unavailable.
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.Services.Exceptions.Exceptions.ProcessModuleLoadException(PortalModuleBase ctrlModule, Exception exc) at McLoide.Modules.MyFAQs.MyFAQSettings.LoadSettings() in C:\DotNetNuke Website2\DesktopModules\McLoide.MyFAQs\MyFAQsSettings.ascx.vb:line 146 at DotNetNuke.Modules.Admin.Modules.ModuleSettingsPage.Page_Load(Object sender, EventArgs e) in C:\DotNetNuke Website2\Admin\Modules\ModuleSettings.ascx.vb:line 264 --- End of inner exception stack trace ---


The 2 functions that are generating this error are (Like I said I have tryed everything to fix the problem so the code is not what we can call beautifull):

Public Overrides Sub LoadSettings()
Try
If (Page.IsPostBack = False) Then
' Read current documentsSettings object

Dim objMyFAQs As New MyFAQsController
Dim objMyFAQsSettings As MyFAQsSettingsInfo
objMyFAQsSettings = objMyFAQs.GetMyFAQSettings(ModuleId)
If objMyFAQsSettings Is Nothing Then
objMyFAQsSettings.ModuleId = ModuleId'objMyFAQs.AddMyFAQSettings(objMyFAQsSettings)

If objMyFAQsSettings.ShowCreatedByUser = 1 Then
chkShowCreatedByUser.Checked = True
Else
chkShowCreatedByUser.Checked = False
End If
If objMyFAQsSettings.ShowCreatedDate = 1 Then
chkShowCreatedDate.Checked = True
Else
chkShowCreatedDate.Checked = False
End If
If objMyFAQsSettings.ShowModifiedByUser = 1 Then
chkShowModifiedByUser.Checked = True
Else
chkShowModifiedByUser.Checked = False
End If
If objMyFAQsSettings.ShowModifiedDate = 1 Then
chkShowModifiedDate.Checked = True
Else
chkShowModifiedDate.Checked = False
End If
Else
If objMyFAQsSettings.ShowCreatedByUser = 1 Then
chkShowCreatedByUser.Checked = True
Else
chkShowCreatedByUser.Checked = False
End If
If objMyFAQsSettings.ShowCreatedDate = 1 Then
chkShowCreatedDate.Checked = True
Else
chkShowCreatedDate.Checked = False
End If
If objMyFAQsSettings.ShowModifiedByUser = 1 Then
chkShowModifiedByUser.Checked = True
Else
chkShowModifiedByUser.Checked = False
End If
If objMyFAQsSettings.ShowModifiedDate = 1 Then
chkShowModifiedDate.Checked = True
Else
chkShowModifiedDate.Checked = False
End If
End If
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub

 

Public Overrides Sub UpdateSettings()
Try
If Page.IsValid Then
Dim objMyFAQs As New MyFAQsController
Dim objMyFAQSettings As New MyFAQsSettingsInfo

'MyFAQ Settings found then update current
objMyFAQSettings.ModuleId = ModuleId

If
chkShowCreatedByUser.Checked = True Then
objMyFAQSettings.ShowCreatedByUser = 1
Else
objMyFAQSettings.ShowCreatedByUser = 0
End If
If chkShowCreatedDate.Checked = True Then
objMyFAQSettings.ShowCreatedDate = 1
Else
objMyFAQSettings.ShowCreatedDate = 2
End If
If chkShowModifiedByUser.Checked = True Then
objMyFAQSettings.ShowModifiedByUser = 1
Else
objMyFAQSettings.ShowModifiedByUser = 0
End If
If chkShowModifiedDate.Checked = True Then
objMyFAQSettings.ShowModifiedDate = 1
Else
objMyFAQSettings.ShowModifiedDate = 0
End If
objMyFAQs.UpdateMyFAQSettings(objMyFAQSettings)
End If
' refresh cache
SynchronizeModule()
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub

 

 

objMyFAQsSettings.ShowCreatedByUser = 1
objMyFAQsSettings.ShowCreatedDate = 1
objMyFAQsSettings.ShowModifiedByUser = 0
objMyFAQsSettings.ShowModifiedDate = 0

 

 
New Post
1/22/2007 7:09 PM
 
what is in "MyFAQsSettings.ascx.vb:line 146"?

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
1/22/2007 11:06 PM
 
"If objMyFAQsSettings Is Nothing Then objMyFAQsSettings.ModuleId = ModuleId"

If objMyFALsSettings is nothing, you cannot use any of it's properties; hence the good old "object reference is not set to an instance of an object".
 
New Post
1/23/2007 9:24 AM
 

That's whats is funny about it. I have on line 146:

ProcessModuleLoadException(

I will change the code taking out the reference of the object and let's see how it goes, but thanks for the help.

McLoide

Me, exc)
 
New Post
1/23/2007 11:37 AM
 

Hey ecktwo your post help me out finding what was wrong with the module but for that I had to check the database and comment line by line until I find what was wrong.

There was 2 errors. The first was in one of the procedures that was referencing the wrong table. Changed the procedure and it worked ok. The second error was that the object was being killed too soon. For fixing that I created another object and used to load the first time page.

After that everything worked fine.

Thanks.

McLoide

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Help PleaseHelp Please


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