Error in WordPress 2.3
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?
Why not outsource the post writing to some Indian company 😉
The same crowd that work in the call centers??
At what stage does the error occur? I didn’t experience it.
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.
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.
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…
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?
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…..
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.
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.
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.
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…
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.
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.
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.
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.
😉
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.
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……… 🙂
Thanks for this heads-up. I was wondering why my new blog was showing all sorts of errors; the information is greatly appreciated!
Hi Ochre. My pleasure. I like your template 😉