How I Fixed My Failed WordPress Upgrade

Date March 25, 2008

Today I visited my site to find that it was down…hard. I tried going into the WordPress administrator and was greeted with a message stating that my installation was out of date and that I needed to upgrade. This message was followed by a link to perform the upgrade.

After backing up my database I clicked the ominous link and waited. I didn’t have to wait too long for the upgrade failure message to appear:

WordPress database error: [Unknown column ‘user_nickname’ in ‘field list’]

So I started Googling and found I was far from alone. Great! There must be a solution out there somewhere, I thought. To my surprise, the vast majority of links led to users that had not yet resolved the issue. Luckily I came across a post on remy sharp’s b:log titled How I Fixed WordPress’ Broken Upgrade.

While Remy’s post did not solve the issue I was having, it definitely got me 50% there. The installation is looking for a column named user_nickname in the wp_users table. So, the first step toward correcting the issue was to add that column using the following sql:

alter table wp_users add column user_nickname varchar(250);

Note that, if you’re using custom table prefixes, you’ll need to change the table name so that it matches yours.

After adding the column I ran the upgrade again and the error was gone. Unfortunately, so was any other feedback or content on the page. What I ended up with at this point was a WordPress banner at the top of the page and absolutely nothing below it. Again, Remy’s solution lent a hand.

While Remy’s post directs you to edit wp-admin/upgrade-functions.php, the code has now been moved to wp-admin/includes/upgrade.php. Turns out that the reason a blank page is appearing is because there is a php error. To fix the error, it was necessary to change a line in upgrade.php (or upgrade-functions.php for older versions) from:

$all_options->{$option->option_name} = stripslashes($option->option_value);

to:

if ($option->option_name) $all_options->{$option->option_name} = stripslashes($option->option_value);

The line in question appears around line 795 (654 in upgrade_function.php).

That’s basically where Remy’s issues ended. Unfortunately I wasn’t so lucky because after running the upgrade again I was still presented with the blank screen. It was at this point that my eyes began turning green. Luckily I was able to calm myself down before my shirt began ripping and my skin turned the same color as my eyes.

I pulled up the upgrade.php file again and began scanning through it. That’s when I noticed that the table names in the SQL statements were hard-coded. While this is fine for a default installation, it’s a BIG problem for people who used custom prefixes on their tables.

If you use custom prefixes you’ll need to change all of the SQL statements to reflect your table names. I’m sure this is a variable but I didn’t have the time or inclination to go looking for it. The SQL code can be found from lines 75 through 110.

After fixing the table names I ran the upgrade again with crossed-fingers and….. it failed again. Grrrrrrr…..

This time at least there was an error to research:

Allowed memory size of 8388608 bytes exhausted

To remedy this issue I had to edit wp-admin/upgrade.php. Note that this upgrade.php file is a different file located one directory up from the upgrade.php that you just finished editing (not confusing at all, right?). I was able to fix the memory issue by adding the following line to the top of the page, just inside the opening PHP tag:

ini_set("memory_limit","12M");

I ran it again and, finally, success … kind of.

The upgrade completed with the following message:

WordPress database error: [Table ‘xx_linkcategories’ doesn’t exist]
SELECT cat_id, cat_name FROM wprg_linkcategories
Upgrade Complete

Your WordPress database has been successfully upgraded!

Remy says to ignore the error so I’m choosing to follow his advice at this point since my site is once again up and running.

I hope this helps some of the stranded WP users out that are having the same issue and can’t find help. I also hope that the WordPress developers address this issue in an upcoming release. It seems bizarre to me that it’s existed through multiple versions.

-rG

del.icio.us:How I Fixed My Failed WordPress Upgrade digg:How I Fixed My Failed WordPress Upgrade spurl:How I Fixed My Failed WordPress Upgrade wists:How I Fixed My Failed WordPress Upgrade simpy:How I Fixed My Failed WordPress Upgrade newsvine:How I Fixed My Failed WordPress Upgrade blinklist:How I Fixed My Failed WordPress Upgrade furl:How I Fixed My Failed WordPress Upgrade reddit:How I Fixed My Failed WordPress Upgrade fark:How I Fixed My Failed WordPress Upgrade blogmarks:How I Fixed My Failed WordPress Upgrade Y!:How I Fixed My Failed WordPress Upgrade smarking:How I Fixed My Failed WordPress Upgrade magnolia:How I Fixed My Failed WordPress Upgrade segnalo:How I Fixed My Failed WordPress Upgrade gifttagging:How I Fixed My Failed WordPress Upgrade

Be Ready for the Flash Player 9 April 2008 Security Update

Date March 11, 2008

Adobe has announced plans to release a security update that could significantly impact existing Flash applications that utilize cross-domain communication.

To quote from their post:

If any of the following situations apply, you should read this article in detail:

* You use sockets or XMLSockets, regardless of the domain to which you are connecting

* You use addRequestHeader or URLRequest.requestHeaders in any network API call when sending or loading data cross-domain
or
You provide access to content on remote domains as a web service provider

* You have SWFs that are exported for Flash Player 7 (SWF7) or earlier that communicate with the hosting HTML by any means

* You use “javascript:” through network APIs to communicate outside a SWF

To defend against malicious HTTP headers, the update requires a cross-domain policy check before allowing SWFs to send headers to another domain.

If you perform any cross-domain communication in your Flash applications, especially those compiled for Flash Player 7 or earlier, you should really take some time to read up on this release.

-rG

del.icio.us:Be Ready for the Flash Player 9 April 2008 Security Update digg:Be Ready for the Flash Player 9 April 2008 Security Update spurl:Be Ready for the Flash Player 9 April 2008 Security Update wists:Be Ready for the Flash Player 9 April 2008 Security Update simpy:Be Ready for the Flash Player 9 April 2008 Security Update newsvine:Be Ready for the Flash Player 9 April 2008 Security Update blinklist:Be Ready for the Flash Player 9 April 2008 Security Update furl:Be Ready for the Flash Player 9 April 2008 Security Update reddit:Be Ready for the Flash Player 9 April 2008 Security Update fark:Be Ready for the Flash Player 9 April 2008 Security Update blogmarks:Be Ready for the Flash Player 9 April 2008 Security Update Y!:Be Ready for the Flash Player 9 April 2008 Security Update smarking:Be Ready for the Flash Player 9 April 2008 Security Update magnolia:Be Ready for the Flash Player 9 April 2008 Security Update segnalo:Be Ready for the Flash Player 9 April 2008 Security Update gifttagging:Be Ready for the Flash Player 9 April 2008 Security Update

ColdFusion Dynamic Argument Naming in Method Calls

Date February 26, 2008

I created a custom tag recently that required a method argument name be passed as an attribute. While I’m familiar with the usual techniques of using dynamic variable names, they didn’t work in this situation.

Here’s what I was attempting to do:

Main Page


<cfmodule template="customtags/deleteRecord.cfm"
				idValue = "1"
				idColumn = "colName" />

Custom Tag


<cfset obj = createObject("component","com.mycomponent")>
<cfset qRecord = obj.getRecord(attributes.idColumn = attributes.idValue) />

The idValue wasn’t an issue but the idColumn wouldn’t work. I tried Evaluate and “#attributes.idColumn#” and a few other similar methods to no avail. Finally, I remembered that you can pass a structure as an argument collection. So I ended up creating a new structure and passing it like this:


<cfset methodParms = structnew() />
<cfset methodParms[attributes.idColumn] = attributes.idValue />
<cfset qRecord = obj.getRecord(argumentcollection = methodParms) />

And that finally worked.

If there’s another solution out there, please enlighten me.

-rG

del.icio.us:ColdFusion Dynamic Argument Naming in Method Calls digg:ColdFusion Dynamic Argument Naming in Method Calls spurl:ColdFusion Dynamic Argument Naming in Method Calls wists:ColdFusion Dynamic Argument Naming in Method Calls simpy:ColdFusion Dynamic Argument Naming in Method Calls newsvine:ColdFusion Dynamic Argument Naming in Method Calls blinklist:ColdFusion Dynamic Argument Naming in Method Calls furl:ColdFusion Dynamic Argument Naming in Method Calls reddit:ColdFusion Dynamic Argument Naming in Method Calls fark:ColdFusion Dynamic Argument Naming in Method Calls blogmarks:ColdFusion Dynamic Argument Naming in Method Calls Y!:ColdFusion Dynamic Argument Naming in Method Calls smarking:ColdFusion Dynamic Argument Naming in Method Calls magnolia:ColdFusion Dynamic Argument Naming in Method Calls segnalo:ColdFusion Dynamic Argument Naming in Method Calls gifttagging:ColdFusion Dynamic Argument Naming in Method Calls

Run Multiple Versions of Firefox on OSX

Date February 21, 2008

John Resig, creator and lead developer of the jQuery JavaScript library, wrote a nice post describing how to run multiple versions of Firefox on OSX without one stepping on the other. Worked like a charm for me so I thought I’d share:
http://ejohn.org/blog/sexy-firefox-3/

del.icio.us:Run Multiple Versions of Firefox on OSX digg:Run Multiple Versions of Firefox on OSX spurl:Run Multiple Versions of Firefox on OSX wists:Run Multiple Versions of Firefox on OSX simpy:Run Multiple Versions of Firefox on OSX newsvine:Run Multiple Versions of Firefox on OSX blinklist:Run Multiple Versions of Firefox on OSX furl:Run Multiple Versions of Firefox on OSX reddit:Run Multiple Versions of Firefox on OSX fark:Run Multiple Versions of Firefox on OSX blogmarks:Run Multiple Versions of Firefox on OSX Y!:Run Multiple Versions of Firefox on OSX smarking:Run Multiple Versions of Firefox on OSX magnolia:Run Multiple Versions of Firefox on OSX segnalo:Run Multiple Versions of Firefox on OSX gifttagging:Run Multiple Versions of Firefox on OSX

AS3 Event Generator Extension

Date February 20, 2008

Lee Brimelow, master of Flash tutorials (see gotoAndLearn.com), has released a free AS3 Event Generator extension for Flash CS3. The extension adds an ‘Event Generator’ option under your Window > Other Panels menu. Once installed you simply select a named movie clip, select the event functionality you require for your application, click the ‘Copy to Clipboard’ button, then paste the code wherever you want it. The Event Generator code adds event listeners for the selected movie clip and creates supporting function skeletons.

Check it out!
Brimelow's Event Generator

rG

del.icio.us:AS3 Event Generator Extension digg:AS3 Event Generator Extension spurl:AS3 Event Generator Extension wists:AS3 Event Generator Extension simpy:AS3 Event Generator Extension newsvine:AS3 Event Generator Extension blinklist:AS3 Event Generator Extension furl:AS3 Event Generator Extension reddit:AS3 Event Generator Extension fark:AS3 Event Generator Extension blogmarks:AS3 Event Generator Extension Y!:AS3 Event Generator Extension smarking:AS3 Event Generator Extension magnolia:AS3 Event Generator Extension segnalo:AS3 Event Generator Extension gifttagging:AS3 Event Generator Extension