I've just upgraded my blog to Drupal 6, but the ability to use Windows Live Writer to update the blog is broken now. When I attempt to post, I get an error message that reads: "Server Error 1 Occurred - Blog API module is not configured to support the 1 content type, or you don't have sufficient permissions to post this type of content."

I've checked all the regular stuff, but nothing seems to do the trick. Not sure what the "1 content type" is. Can anybody shed any light on this?

Comments

gpk’s picture

1. Did you check the blog, blogapi and node permissions at admin/user/permissions?
2. You might need to "reset" WLW i.e. remove the blog from WLW and add it again in case settings have changed.
3. Any more messages in the Drupal logs (dblog module nowadays)?

gpk
----
www.alexoria.co.uk

Gerard McGarry’s picture

Have checked all those things thanks, but no joy. WLW detects the blog type correctly as Drupal, but refuses to download the blog template and throws up an error when you try to refresh the category list.

Interestingly, there are a few entries in the logs looking for a wlwmanifest.xml file. Hmmm. Bet Drupal doesn't provide that out of the box?

gpk’s picture

What happens if you tell WLW to use blog type of Blogger or Movable Type?

gpk
----
www.alexoria.co.uk

Gerard McGarry’s picture

No difference - presumably I still have to point WLW at the /xmlrpc.php file in order for it to do posting properly?

I have managed to post a blog item, but wasn't able to set a category for the post because WLW wouldn't detect the category list.

gpk’s picture

>presumably I still have to point WLW at the /xmlrpc.php file
Yes.

>I have managed to post a blog item
Progress, then?!

Sounds like this needs some other people to test for comparison (WLW and other clients). I've not had these problems with ScribeFire.

gpk
----
www.alexoria.co.uk

kylehase’s picture

+1

I too notice the exact behavior mentioned above.
Template download error.
Error when attempting to post.

Server Error 1 Occurred

Blog API module is not configured to support the 1 content type, or you don't have sufficient permissions to post this type of content.

Gerard McGarry’s picture

To anyone else who's had a problem with this, there's a bug in the blogapi module that causes a few problems when trying to list the blog categories. There's a patch here.

kylehase’s picture

Gerard, I applied your patch against the D6.0 blogapi.module and I'm still having problems. When I try to run the WLW "Update Style" tool it says

The style template used for editing your weblog posts could not be downloaded. You will be able to post to this weblog, but the editor will not use your weblog's style

When I try to post a blog I receive the following error

Server Error 1 Occurred Blog API module is not configured to support the 1 content type, or you don't have sufficient permissions to post this type of content.

I tried with both user1 and another user.

The patched function is as follows

function blogapi_metaweblog_get_category_list($blogid, $username, $password) {
  $user = blogapi_validate_user($username, $password);
  if (!$user->uid) {
    return blogapi_error($user);
  }

  if (($error = _blogapi_validate_blogid($blogid)) !== TRUE) {
    // Return an error if not configured type.
    return $error;
  }

  $vocabularies = module_invoke('taxonomy', 'get_vocabularies', $blogid, 'vid');
  $categories = array();
  if ($vocabularies) {
    foreach ($vocabularies as $vocabulary) {
      $terms = module_invoke('taxonomy', 'get_tree', $vocabulary->vid, 0, -1);
      foreach ($terms as $term) {
        $term_name = $term->name;
        foreach (module_invoke('taxonomy', 'get_parents', $term->tid, 'tid') as $parent) {
          $term_name = $parent->name .'/'. $term_name;
        }
        $categories[] = array('categoryName' => $term_name, 'categoryId' => $term->tid);
      }
    }
  }
  return $categories;
}
prophetizer’s picture

the patch works to get the categories, but it doesn't post the blog using those categories. so any other ideas?

Dr Jay’s picture

Not that I have anything unique to contribute, but I too am having the same problem after a 6.0 upgrade. I know blogapi has to be enabled for content types, and obviously for some reason it is passing an argument of '1' instead of 'blog' or whatever used to be passed. Despite the extra validations, the actual function appears to be roughly the same, so I can't see why the change but i would vastly appreciate if someone figures it out and lets the rest of us know.

Dr Jay’s picture

Just out of curiosity I also tried copying the previously working copies of blogapi.module, xmlrpc.php, etc. from 5.x to the 6.0 installation. Instead of the normal error, I now get a username/password error (which are correct and working until the upgrade) so I am now wondering if the problem extends beyond these modules and into the blog.module as well?

kylehase’s picture

Not sure about 5.x but I did test WLW before the Drupal gold release and it worked. It was a release candidate but I'm not sure which one.

kylehase’s picture

Just copied the 6.0-rc3 blogapi.module over the 6.1 module as a test and found that WLW worked with RC3.

kylehase’s picture

Found this blog http://www.technacular.com/2008/02/17/configuring-windows-live-writer-to...

Instead of having WLW detect the blog settings, the author enters them manually.

Use "http://example.com/node/add/blog" as weblog homepage.
It seems that this basically makes WLW fail to auto detect the API type.

Select "wordpress 2.2+" as the blog type.
Enter "http://example.com/xmlrpc.php" as the remote URL

The only problem is that this only works for blog node types. If you repeat this procedure for other node types the other node types will be unable to display in the "web layout". What I did was add several duplicate "blog" entries for each node type, giving each a unique name in WLW then update the "BlogId" in regedit.

Go to HKCU\Sofware\Microsoft\Windows Live\Writer\Weblogs

There you'll see a key for each of your WLW blogs. Change the "BlogId" for each to the node type and it will post as that node type.

prophetizer’s picture

vid, vocabulary into the document, so when it's posted it's on the document? so that i can sort, search, and whatnot on those specific types

kylehase’s picture

As far as I could tell WLW uses a different tag system that is not compatible with Drupal's taxonomy. I'm only using WLW for writing and formatting then manually adding taxonomy terms. It's a pain but beats writing in code in the webform or using poorly supported wysiwyg editors.

If you figure out a way please let me know.

prophetizer’s picture

actually, it is working for me now. i used the moveabletype api and it seems to be working, although, i had to apply the patch from above to get it working properly. and thank goodness it's working lol

kayaker’s picture

After applying the patch and reading the comments carefully, I, too, have WLW posting w/categories to Drupal 6.1.

Why does the BlogAPI project page reference Blogger API and MetaWeblog API?

I tried Blogger first. When it posted, there was HTML thrown all over the node page. This was from Google Docs. Very ugly and very frightening. I changed Google to MetaWeblog and it posted cleanly - but I wasn't using categories.

Next, I switched to Windows Live Writer using MetaWeblog and it appeared to be working except for the categories. Applied the patch and the cats show up in WLW. Posting content works fine, but the cats never make it to Drupal.

Only upon the nth reading of prophetizer's last message did I pick up on the third choice of Moveable Type API.

Using Drupal 6.1 with BlogAPI patch and WLW 12.0.1367.1128 with Moveable Type API selected works.

prophetizer’s picture

so will this actually get added into drupal at some point, so i don't have to patch it on sites?

Corey Smith’s picture

kramed’s picture

Thanks Corey, works great.

SubtleTechnology’s picture

Here is up to date information on using Windows Live Writer with Drupal 6...
http://www.subtletechnology.com/content/how-post-your-drupal-6-blog-usin...

I still need to look at the image uploading through the blogapi but other than that it works well.

sonicthoughts’s picture

Without it I couldn't add categories.

jdleonard’s picture