Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  Blog Module [Le...  Search is currently unavailable
Previous Previous
 
Next Next
New Post 7/18/2008 11:33 AM
User is offline Declan Ward
160 posts
www.dws.ie
9th Ranked




Search is currently unavailable 

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 1:19 PM
User is offline Declan Ward
160 posts
www.dws.ie
9th Ranked




Re: Search is currently unavailable 

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 2:26 PM
User is offline OCGuy
37 posts
10th Ranked


Fixing a Deleted Blog 
Modified By OCGuy  on 8/10/2008 4:07:36 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 Stordeur
OneConnection Business Solutons
 
New Post 8/7/2008 2:45 PM
User is offline Don Worthley
216 posts
www.itcrossing.com
9th Ranked




Re: Search is currently unavailable 

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
IT Crossing Logo

Try metaPost today! Adding Web 2.0 Styled Content is Fun and Easy.
 
New Post 8/7/2008 2:47 PM
User is offline Don Worthley
216 posts
www.itcrossing.com
9th Ranked




Re: Fixing a Deleted Blog 

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
IT Crossing Logo

Try metaPost today! Adding Web 2.0 Styled Content is Fun and Easy.
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  Blog Module [Le...  Search is currently unavailable
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Web Valley
Website design, Database development
www.webvalley.com
UK DotNetNuke CMS installation, hosting & support
UK based installation, branding, customising, integration, hosting, training, support and maintenance services for DotNetNuke
www.deburca.co.uk
Need Help with your DotNetNuke website?
Jango Studios offers exclusive DotNetNuke Skin Design, Module Development, Web Marketing and Web Hosting.
www.jangostudios.net

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP