Will "the Mighty" Strohl

Is Your Child Blog Missing from the WLW Import?

In a previous blog entry tonight, I briefly outlined that I was not able to import one of my child blogs when attempting to use the Windows Live Writer (WLW) method of blogging to a DotNetNuke blog.  It was quite perplexing.  I even posted a forum post about it, as I could not find any information about anyone else having the same issue.

To quickly recap, I followed the instructions provided in a blog post by Antonio Chagoury.  In Step 4, WLW shows you a list of available blogs to choose from.  I would imagine that most folks would only have a single blog entry available in the list.  However, if you're like me, that may not be true.

In my instance, I have a parent blog of which I do not post to.  Then, I have two child blogs, Personal Edition, and Professional Edition.  (I named my child blogs before the DNN PE announcement.)  The Professional Edition is where I post all of my DotNetNuke related entries.  Everything else goes into the Personal Edition.  I go into more detail about this configuration in an earlier blog post.  Basically, it allows me to split up the RSS feeds pretty painlessly.

Back to step 4... Professional Edition was missing from my list of available blogs to connect WLW to. There didn't appear to be any real reason for this.  My first instinct was that this was a new bug that I had found.  This turned out to be mostly true.

Background Information

The DotNetNuke Blog Module allows any blog owner to create child blogs for a variety of reasons.  When the blog owner creates such a blog, the blog module inserts their UserId into the new blog record.  Sounds simple enough, but if you're not careful, this work flow can be easily disrupted.

The Super User or Host account was designed to be able to do anything on an entire instance of DotNetNuke.  In the case of the blog module, this account takes more of a moderation role.  For example, being able to manage rogue bloggers, or inappropriate posts.

In the case of existing blogs, the Host account can create child blogs for the actual blog owner.  This behavior is important to note, as this is the cause of the problem I am writing about.

Why is the Child Blog Missing from WLW?

When the actual owner of a blog creates their own child blog, everything works as expected.  But when a Host creates a child blog on someone else's existing blog, the UserId that is inserted into the blog record is that of the Host account.  If you are not using a tool like WLW, the different UserId might never present a problem.  However, when you use WLW, the first step asks for authentication information.  This information includes the blog URL, username, and password.  When WLW pulls a list of available blogs from your blog website, it only pulls the blogs that match the UserId matching the given username.  BINGO!

How Do We Fix This?

Fortunately, the fix for this problem is quick and easy.  That is, as long as you have either direct access to the database, or a Host account.  I will assume here that you're using a Host account.  The first thing we need to do is figure out what the BlogID is for the child blog that is missing.  We can do that using a bit of T-SQL.

Using the host account, you would run the following query using the SQL page, found in the Host menu.  Make sure you check the "Run As Script" checkbox.

SELECT * FROM {DatabaseOwner}{ObjectQualifier}blog_blogs

Using the previous query, be sure to take note of two things.  First, note the UserID that is assigned to the other blogs that are not missing.  Second, take note of the BlogID for the missing blog.  I will refer to both of those values as X and Y, respectively.

Run the following query, replacing X and Y with the values you found in the previous query.

UPDATE {DatabaseOwner}{ObjectQualifier}blog_blogs SET UserID = X WHERE BlogID = Y

That's all there is too it!  You can now import the missing child blog into WLW.

Technorati Tags: , , , ,

blog comments powered by Disqus