Error in WordPress 2.3

September 30th, 2007

I just upgraded my blog. I’m getting really good at this!!

But the upgrade f*cked up my site.

Apparently, there is an error in the new code, so that when you upgrade, you may get an error -

Warning: array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer in blah/blah/blah/wp-includes/category-template.php on line 176

Now I did some research and apparently there is a line in a file called wp-includes/category-template.php.

That line says

if(array_key_exists($category, $categories))

What it should say is

if(array_key_exists(‘$category’, $categories)) [with the little quotes].

That fixed it!!!

And now I can do all sorts of fancy things like change the colour of the text.

Or play cards – ◊ ♣ ♥ ♦.

I wonder if it will write my posts for me?

21 Responses to “Error in WordPress 2.3”

  1. Niall IRELANDon 30 Sep 2007 at 4:19 pm

    Why not outsource the post writing to some Indian company ;)

  2. Grandad IRELANDon 30 Sep 2007 at 4:53 pm

    The same crowd that work in the call centers??

  3. Primal Sneeze IRELANDon 01 Oct 2007 at 4:35 am

    At what stage does the error occur? I didn’t experience it.

  4. Grandad IRELANDon 01 Oct 2007 at 10:34 am

    Sneezy – Apparently the problem occurs only with some templates. Somehow I find myself in the position of having quite a few blogs to look after ["Granny Lost The Plot" and "K8 the GR8" to name but two, apart from my own]. The problem arose on about half of them.

    Strangely, my own theme was specifically mentioned, but I had no problems with it.

    If the problem occurs, you get that error message appearing over every post, which looks very messy.

  5. Primal Sneeze IRELANDon 01 Oct 2007 at 11:11 am

    I see. I’ll stick with my current template then.

    Have to say, my upgrade was painless except for having to substitute a couple of plugins. I hope this hasn’t lured me into complacency as the plan is to bump up a another few blogs next weekend for clients. I used my own two as guinea pigs.

  6. Robert Synnott IRELANDon 01 Oct 2007 at 11:40 am

    Ah, the joys of weak dynamic languages.

    I suspect that the $category variable ended up containing NULL, or something.

    This is really the sort of thing that they should be catching in testing…

  7. Grandad IRELANDon 01 Oct 2007 at 12:18 pm

    Now don’t get all technical on me, Robert. You know it confuses me.

    I suppose you’d have to make allowances for them though as they can’t test under every template?

  8. Manuel UNITED KINGDOMon 01 Oct 2007 at 9:31 pm

    I tried WP for about 36 hours non-stop and got no where. I ended up in a sweaty mess in the corner of the room…..

  9. Kimberly UNITED STATESon 02 Oct 2007 at 4:14 am

    I’m scared to update to 2.3 for this very reason. If I see something like that I’ll freak and won’t know what to do.

  10. Grandad IRELANDon 02 Oct 2007 at 11:12 am

    Manuel – You have me confused? The WP you refer to can’t be WordPress as that wouldn’t have that effect. Is your WP some kind of sexual perversion?

    Kimberly – I updated a few sites, and only had a couple of problems. You will more than likely have no problems. It is worth it, as you get some extra features.

  11. Primal Sneeze IRELANDon 02 Oct 2007 at 7:19 pm

    Not being as techie as you Grandad, I’m hesitant to comment … but I suspect the issues are with plugin conflicts not themes. Themes don’t normally interfere with the underlying code in the way plugins do. Were all plugins disabled at upgrade? Did 2.3, once installed, show alerts as to which should be updated?

    I’m not picking at you – I’m trying to prep myself for the upgrades I promised to do next weekend. All to be done pro bono (no U2 connection) but I like to do things right.

  12. Grandad IRELANDon 03 Oct 2007 at 11:46 am

    Me? Techie? Hah!

    I’m a bit baffled as to the cause. This blog has more plugins than are good for it and has one of the themes that was red-flagged, yet the upgrade went perfectly.

    K8 the GR8′s log is a different them but uses the same plugins as here [but not as many] and that failed.

    Upgrading automatically disabled all plugins, and I just re enabled them after.

    One of the features of 2.2 is that it automatically notifies you if there are newer releases of plugins, which it did in my case…

  13. Kirk M UNITED STATESon 05 Oct 2007 at 11:08 pm

    Going Like Sixty dropped by while I was reloading my install and let me know of the bug you found. It didn’t seem to affect me so I would have never known about it. Thanks for tracking it down and letting us know.

  14. Just Thinkin back online | Just Thinkin' UNITED STATESon 06 Oct 2007 at 12:26 am

    [...] take exception to the bug, I fixed it anyway just in case. Anyone running WP 2.3 might want to head over and take a look and do the fix [...]

  15. Grandad IRELANDon 06 Oct 2007 at 11:22 am

    Hi Kirk M. You mean to say you let Sixty into the house? That sounds risky?

    Thanks for highlighting the fix. I can’t take credit for it, as someone else found the bug. But it was hard to find the fix on the Interweb.

  16. Kirk M UNITED STATESon 06 Oct 2007 at 12:28 pm

    Hey Grandad,

    No more risky than letting me into yours although I made him wipe the mud off his shoes first. Heck, I’m an old(er) Vermonter, ex-Cold War submariner and 17 year Harley Rider (service related injuries finally took me off two wheels). So what’s the risk?

    I know all to well how hard it is sometimes to track down a reclusive WP problem (forum’s about useless) especially the kind you were experiencing. The one which caused me to finally wipe out my old install and load a fresh one was just that type although it was to intermittent to pin down to a cause.

  17. Grandad IRELANDon 06 Oct 2007 at 2:15 pm

    Hi Kirk. Are you sure it was mud on his shoes?

    My WP problem was that I was upgrading my daughter’s blog and I hadn’t told her I was doing it. The next thing that damned error appeared, and there was no going back. I had to fix it and pronto, before she found out!

    So are we mature people taking over the Interweb at last? I must do a post about that. Confine the under 30′s to Bebo and let the rest of us talk sense.
    ;)

  18. Kirk M UNITED STATESon 06 Oct 2007 at 9:40 pm

    Ayuh, ’twas dirt alright. Otherwise he would have had to remove his foot gear outside.

    And going behind your daughter’s back like that? That’s just inviting trouble ya’ know. Glad you got it fixed before she found out.

    Would you believe there’s actually a ton of us mature type bloggers out there. Surprised even me at the amount of “boomer” type blogs around. Seems I’m one of them. I’ve even read where some younger folks are calling us elderly bloggers. Well, by God let me go grease up that wheelchair of mine–I’m feeling a might peak-ed.

  19. Grandad IRELANDon 07 Oct 2007 at 11:10 am

    I always go behind my daughter’s back. It is my form of retaliation for her teenage years.

    As for your last paragraph – Blog post coming up……… :)

  20. Ochre PAKISTANon 05 Nov 2007 at 4:07 pm

    Thanks for this heads-up. I was wondering why my new blog was showing all sorts of errors; the information is greatly appreciated!

  21. Grandad IRELANDon 05 Nov 2007 at 4:37 pm

    Hi Ochre. My pleasure. I like your template ;)

Trackback URI | Comments RSS

Leave a Reply

NOTICE FOR SPAMMERS:
Please note that any comment or link that tries to promote any website that isn't a blog will be unceremoniously dumped into a black hole where it belongs. If you ignore this, you may leave yourself open to nuclear attack, or any other punishment I deem fit.
And don't try appealing to my better nature - I don't have one.

CommentLuv badge