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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsBlogBlogSearch is currently unavailableSearch is currently unavailable
Previous
 
Next
New Post
7/18/2008 1:33 PM
 

The error below shows in the search panel of the Blog module. Can anyone suggest where to look ?

Using DNN 4.8.3 and Blog 3.4

Error: Search is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Value cannot be null. Parameter name: container ---> System.ArgumentNullException: Value cannot be null. Parameter name: container at System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) at System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) at System.Web.UI.WebControls.ListControl.PerformDataBinding(IEnumerable dataSource) at System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.ListControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at DotNetNuke.Modules.Blog.Search.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---


 
New Post
7/18/2008 3:19 PM
 

This error was caused by deleting the user that had created the blog.

The table Blog_Blogs contains a field UserID which is used in the stored procedure Blog_GetBlog. In my case UserID 7 was missing. I changed the UserID on the Blog_Blogs entry to a valid UserID and the problem was solved.

Is this a bug or design omission? I suspect it is a situation that will not arise very often.

<rant>
Perhaps rather than just throwing a blanket exception a message with some indication of the cause might help. This is one of my main complaints about DNN - exceptions logged without any real indication of the cause. Surely developers would not get away with this in their own work. At a minimum an error message should indicate where the error occurred and some inidcation of what the application was attempting to do at the time.

This is just a cop-out and often useless:

            Catch exc As Exception
                ProcessModuleLoadException(Me, exc)

A little more is needed to tell us where the error occurred and why.
In this instance the error states that "Value cannot be null". This is correct as the usertable joined in the stored procedure will return null for the requested user because the row has been deleted.

Rather than catching the exception in page load, having filtered back up from the call to the db, why not log the exception earlier with a little helpful information.

Instead of (which we se everywhere!):
        Public Overrides Function GetBlogByUserID(ByVal PortalID As Integer, ByVal UserID As Integer) As IDataReader
            Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "Blog_GetBlogByUserID", PortalID, UserID), IDataReader)
        End Function

Would something like this be better:
        Public Overrides Function GetBlogByUserID(ByVal PortalID As Integer, ByVal UserID As Integer) As IDataReader
            Dim idr As IDatareader
            Try

                idr = CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "Blog_GetBlogByUserID", PortalID, UserID), IDataReader)
                If idr Is Nothing Then

                    ' Personally I use log4net to log messages in debug situations.
                    ' available free here:
logging.apache.org/log4net/index.html
                    log.Debug(String.format("Blog:GetBlogUserByID: Portal {0}, UserID {1}", PortalID, UserID))  
                End If

            Catch ex As Exception
                log.Debug(String.format("Blog:GetBlogUserByID: Portal {0}, UserID {1}", PortalID, UserID))
            End Try
            Return idr

        End Function

At lease we would know where something happened and a little about why.
</rant>

Rather than just rant I am prepared to assist in adding such error handling to DNN code, if such help is desired. Perhaps others have better ideas. If so I would like to hear them. Many of the posts in the DNN forums are seeking help on errors from the Event Log such as the one I posted above.

I am unable to add this to the Blog project on Gemini.

Declan


 
New Post
8/7/2008 4:26 PM
 

Because we have run into this several times, I thought I would post the solution when a user accidentally deletes their blog.  Yes, they think they are deleting an entry and they hover over the menu and see 'delete blog'.  Guess what?  After a single, standard warning, they say yes and delete their entire blog!

Not as bad as you might think.  It only deletes the entry in the Blogs_Blogs table.  All the content is still in the database.

You will need acess to your DB to fix:

OK. As you know, the blog is assigned to a user.  When the module is deleted, you can't simply put another one back.  As soon as you put the blog modules back, you get an error trying to configure them. It's because there is a setting in the Blog_Settings table that says the PAGE contains a specific blog. And, of course that blog no longer exists.

Follow these steps:

  1. You need to lookup the DNN userid of the person the blog belonged to.  In the User Accounts.
  2. Open the Blog_Entries table. You should be able to identify the entries that were in the old blog and find the old blogid there.
  3. Go to the Blog_Blogs table and find the userid.  Get the new blogid number.
  4. Go to the Blog_Settings table and find the the the entries for the tab (Page) you are working on.
  5. Change the PageBlogs setting to the new id. You can verify that it is the right entry because the current entry should match the old blogid.
  6. Your blog should now be working, but there are no entries!.  No problem.  Go to the Blog_Entries and execute the following SQL script:

BE CAREFUL. BACKUP YOUR BLOG_ENTRIES TABLE OR YOUR ENTIRE DB FIRST!
update blog_entries
set blogid= use the new blog id here
where blogid = use the old blogid here

Except for the created dates and 'last entry dates' for the blog, you should now have the blog restored to working order.

Hope this helps


Bob
 
New Post
8/7/2008 4:45 PM
 

Hi Declan,

This is a great post and your help would be appreciated.  If you're interested in joining the blog team, just let Antonio know.  Having someone who is interested in making sure the exception handling is done properly would be great.

Regarding your ability to post to Gemini, all project posts go through the DNN Core Framework and Modules section.  There's a place when you create an issue where you can specify the project to which the issue relates.

Thanks,

Don



Don Worthley
Software Architect
Element Eleven

 
New Post
8/7/2008 4:47 PM
 

OCGuy,

Thanks for posting this workaround to the forums!  I'm sure this will come in handly for others who run into the same issue.

Don



Don Worthley
Software Architect
Element Eleven

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsBlogBlogSearch is currently unavailableSearch is currently unavailable


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