Viewing By Entry / Main
July 24, 2006

Over the weekend, I noticed that several of my older blog posts weren't showing up when I searched for them on my site. After a little more digging, I found that several hundred seemed to be missing. I couldn't get to them via a search, by date, or even by their UUID directly in the URL. I checked the database tables, and sure enough they were there.

After a little more digging, it turns out the problem has to do with having upgraded from blogCFC 3.x to 4.x to 5.x. Along the upgrade path, changes there were several additions to the blogCFC database, as well as the core CFC code. One of those changes introduced a new field in the tblBlogEntries table called username. The username is supposed to contain the username of the person making the blog entry. In my case, all "new" blog entries from blog CFC 4.x on had a value in this field. Older entries, from the blogCFC 3.x days didn't. Instead, they were NULL. This caused the main method in blogCFC.cfc to return no results for entries with NULL for the username. You can see why in the WHERE clause for the getEntry method:

where   tblblogentries.id = <cfqueryparam value="#arguments.id#" cfsqltype="CF_SQL_VARCHAR" maxlength="35">
and   tblblogentries.blog = <cfqueryparam value="#instance.name#" cfsqltype="CF_SQL_VARCHAR" maxlength="50">
and   tblblogentries.username = tblusers.username

Once I made an entry in the username column for all of my "legacy" entries, all of the posts started showing up as expected.

Related Blog Entries

Comments
Scott Stroz's Gravatar Rob - I can empathize, though I went right from version 3.something to version 5. I basically started with a brand new DB, and imported my old entries into teh new DB using DTS and/or ColdFusion.
# Posted By Scott Stroz | 7/24/06 7:17 PM
Rob Brooks-Bilson's Gravatar Yeah, I guess that's why it pays to keep up with the blogCFC releases ;-)
# Posted By Rob Brooks-Bilson | 7/31/06 10:48 AM



Copyright 1995-2008 Rob Brooks-Bilson. All rights reserved.
Aura skin for Raymond Camden's BlogCFC inspired by Joe Rinehart & Steven Erat. This blog is running version 5.5.1.