WordPress 2.1 broken blogroll fix

I recently upgraded this site to WordPress 2.1 and quickly found that there are still a few bugs in the code. One of the more obvious ones was that my blogroll was broken. Others have reported the same thing, while others haven’t. This leads me to believe that it is more of a template issue than anything. More in the code used to call the blogroll than in the WP code itself. Of course, it worked before, so why doesn’t it now?

It took me a little while and some indepth looking in my databases, but I did find a fix for it in my template. I would imagine that most of the others can be fixed in the same fashion.

Here is the code that was used before the upgrade to pull the blogroll:

blogroll code before

And here is the code with the change that makes it work:

Blogroll code after

I haven’t a clue what changed in the WP code, but it basically fubar’d the SQL that pulled the blogroll. Essentially, the -1 in the first bit of code was getting appended to a column name in the SQL rather than the column having it’s proper name in the SQL. So it became CAT_-1 instead of the CAT_ID that it should have been. Changing the -1 to ID seems to have alleviated the problem. It also doesn’t appear to have broken anything by making that change so for now I leave it.

Technorati Tags: , , , ,

About Shane Ede

Shane Ede is an IT guy by day and a Entrepreneurial Blogger by night. You can follow him here on Thatedeguy or over on Twitter and Google+.

Comments

  1. Nice post – but I would highly suggest putting the code in code tags so that visitors can copy/paste it. Using an image means that you have to type it whilst looking at the image, quite tedious if you don’t have dual screens.

Speak Your Mind

*