• Hi! Ping.fm Custom URL from Matt Jacob just got an upgrade to version 2.0.0, which does some database magic to upgrade all past pings… and, in my case, broke down. Now the settings say:

    You Shouldn’t Be Seeing This

    This is an error message, and error messages suck.

    That’s why you shouldn’t be seeing this one right now. On a most unfortunate note, we encountered an error while attempting to upgrade the old pings in your database.

    Your data is safe, but you won’t be able to use the latest version of this plugin until the situation gets sorted out.

    If you want to be really helpful, click the button below to report the problem. Your email address will be included in the report, but we’ll only use it to get in touch with you so that we can help you fix whatever it is that’s causing this plugin to puke.

    Alright: less talk, more click. Get on it!

    Nice, mmh? Well, uninstalling and even deleting all files and re-installing from scratch (even after manually deleting all posts on the Ping.fm category) has no effect. I’m assuming something got written somewhere (the options are serialized and not editable from the backend) to make sure this message is always shown.

    I went into the database, looked up under the table wp-options, searched for pingfm_options, and where there was:

    s:13:”upgrade_error”;b:1;

    I changed it to

    s:13:”upgrade_error”;b:0;

    This allowed the upgrade attempt to be run once again. However, it gives precisely the same error 🙁

    So I’ve deleted pingfm_options, the “Ping.fm” category, and dumped the wp_pingfm table for good measure; then deleted the plugin and reinstalled it from scratch (*sigh*).

    No luck. Even when going with all that trouble, it still fails with:

    Fatal error: Call to undefined function wp_create_category() in /home/gwyneth/gwynethllewelyn.net/wp-content/plugins/pingfm-custom-url-status-updates/classes/PingFmCustomUrlUtils.php on line 61

    Aha! Forums to the rescue!

    So I went to that file and on line 61 just commented out

    /* $this->default_category =  wp_create_category('Ping.fm'); */

    and replaced with:

    if(!($this->default_category = is_term("Ping.fm", "category"))){
              $args = array('description' => "Ping.fm", 'parent' => "0");
              $this->default_category = wp_insert_term("Ping.fm", "category", $args
            }

    Note that is_term is supposed to be deprecated and to be replaced by term_exists. Hopefully Matt Jacob reads this and changes his code accordingly 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’ll continue our email discussion here for the benefit of anyone else who happens upon this thread.

    Basically, deleting the pingfm_optionsoption without first deactivating the plugin was a bad idea. 😉 The reason is because the plugin tries to create that option if it doesn’t already exist, and 99.999% of the time, that happens during plugin activation. Well, the wp_create_category() function is part of the admin API, and therefore, it’s only available during admin things (like plugin activation, for example).

    When you deleted the option, the plugin tried to recreate it outside of the admin API files being included, and the function simply wasn’t defined at that point. You exposed an edge case, and it’s been fixed in version 2.0.1, which was just released.

    As for the initial problem during the upgrade, it’s impossible to say what actually happened without seeing the original data. Prior to plugin version 2.0.0, status updates and micro-blog posts from Ping.fm were stored in a plugin-specific DB table called wp_pingfm. As of version 2.0.0, those same ping types are being stored in the main wp_posts table with a custom post type of pingfm.

    During the upgrade, the plugin tries to take everything from the custom table and import it into the standard WP table. It checks the counts to see if everything was imported successfully, and if the counts match up, it tries to drop the old table. If the counts don’t match up, the upgrade is declared a failure, and you’re asked to submit a bug report to me for help. I do my best to test the plugin thoroughly with a variety of data and environments, so I was surprised to find out it had failed for you.

    I’m glad you got the problem sorted out on your own, and I think you’ll really like version 2 now that it’s working properly.

    Happy pinging!

    Matt

    Thread Starter Gwyneth Llewelyn

    (@gwynethllewelyn)

    Thanks for the very, very thorough reply, Matt! I sincerely hope that the extreme edge case I found actually never happens any more.

    And I do apologise for taking so much of your time just to figure out that deleting pingfm_options was really a bad, bad idea…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ping.fm Custom URL broke database of Ping.fm posts – how to reset and restart’ is closed to new replies.