Fixing some Orchard CMS blog problems

Blog archives part not working when blog is the site home page

When you create a new blog in Orchard CMS and set it to be the home page blog archives list (part) refuses to display anything. Reason for this seems to be that Orchard database table called Orchard_Blogs_BlogArchivesPartRecord has a column called BlogSlug, and it defaults to “blog” even though blog is the home page (i.e. slug = “”). A clear bug, but I didn’t want to wait for a fix and just changed the value to null, and list of archived blog posts came to life.

Here is the SQL I used, note that the Id is specific to my scenario, if you use this change it to your blogs Id:

UPDATE       Orchard_Blogs_BlogArchivesPartRecord
SET          BlogSlug = NULL
WHERE        (Id = 25)

 

Windows Live Writer + Orchard messes created and published dates

When you create blog posts with Windows Live Writer and put a historical Post date to the post, this date will end up being the created date, and published date will be the date of writing. This affects e.g. RSS feed and archives list. I just moved 95 blog posts from years 2003-2011 to a new blog and my archives list looked like this after beforementioned BlogSlug fix:

image

Not exactly what I was after. Time for another fast hack SQL; again, Container_id is specific to my DB, don’t just blindly run this on your DB:

UPDATE       Common_CommonPartRecord
SET          PublishedUtc = CreatedUtc
WHERE        (Container_id = 8)

Now blog posts have correct times. This does not immediately fix the issue: Orchard seems to update archive list e.g. when next blog post is created. I created a dummy post and removed if, and now my archive looks correct:

image

…except that current year displays empty, but that probably is an issue with the theme and needs some more attention in the future.

Tags: orchard

9 Comments

  • Nathan Heskew said

    Bertrand might find this post particularly interesting since he's having (or recently had) problems with the archives in his blog.

    It seems the blog archives were forgotten about with the change in 1.2 to use the created date as *the* date the content was first published...

  • Tero Teelahti said

    Good to hear that there is a reason for the weird behavior. Maybe I should create a formal bug out of this...

  • Tero Teelahti said

    Issues created:
    http://orchard.codeplex.com/workitem/18064 and http://orchard.codeplex.com/workitem/18065

  • Leroy Vaughan said

    Any idea how I can get a tag cloud to show up in the latest version of Orchard? I set it up as a Blog and I don't have a blog archive at all. I haven't tried modifying the table yet though.

    I also don't have a tagcloud and I installed the Vandelay Industries 1.30 module (twice).


    Thanks.

  • Tero Teelahti said

    Sorry, I haven't played with the newest Orchard version and don't know of any new blog problems introduced there.

Add a Comment