Forums

Custom Taxonomies Plugin error when I upgraded to 3.0. Need my info back! (11 posts)

  1. fballoni
    Member
    Posted 1 year ago #

    I like to upgrade my wp and to stay up-to-date with it.

    I have a website that uses custom taxonomies to improve the navigation, giving users more options. I know that the new wordpress has Custom Taxonomies support. But before upgrading it, I was using a plugin called Custom Taxonomies (http://wordpress.org/extend/plugins/custom-taxonomies/) in my wp 2.9.2 version. It does the same thing as the wordpress new support (http://net.tutsplus.com/tutorials/wordpress/introducing-wordpress-3-custom-taxonomies/).

    when I upgraded to 3.0, I got the error:

    Fatal error: Call to a member function add_rewrite_tag() on a non-object in .../taxonomy.php on line 289

    I deactivated the custom taxonomies plugin and there was no more error. But I don't have my custom taxonomies anymore! My blog makes 3 posts a day using those taxonomies, tags and categories too. I did it for months and now I lost this feature! I know that I have this information in my database (the plugin wrote it). But I can't activate this plugin to retrive those taxonomies.

    Also I can't find the table that lists all of my taxonomies relations to all my posts. But i know it's there somewhere.

    I need to restore this information from the database and keep my existing custom taxonomies made from this plugin! Is there a way to restore this, keeping my new wordpress 3.0??? Custom taxonomies are important to my site. But I cant work around hundreds of posts! It will take me a life time to do all this work again!

    The info is in the database! is there a way to restore it?? or to transform it to the new wordpress feature? anyone please help!!! my website has decreased quality without my custom taxonomies! Just because I upgraded to 3.0. that really sucks. It's not fair.

    I would like not to wait to this plugin to upgrade. I have to restore this ASAP. Please, help me !!!!

    Thanks and kind regards from Rio de Janeiro, Brazil.

  2. Andrew Nacin
    WordPress Dev
    Posted 1 year ago #

    Considering that the plugin was last edited in February 2009, and is marked as compatible up to WordPress 2.7, I doubt it will be getting an upgrade any time soon.

    Your data is safe, I can assure you of that. However, your issue is that the plugin is incorrectly registering the taxonomy too early. Basically, it's trying to set up URL rewriting before the URL rewriting module is even loaded. In 2.9, it failed silently; in 3.0, there's a bit more noise.

    You could probably fix this with a small modification to the plugin. Note line 62:
    http://plugins.trac.wordpress.org/browser/custom-taxonomies/trunk/custom-taxonomies.php?rev=95735#L62. Add a line before line 62 that says:

    function custax_register_on_init() {

    Then after line 70, add this:

    } // end custax_register_on_init()
    add_action( 'init', 'custax_register_on_init' );

    I can't speak for whether the plugin does anything else with the taxonomies it creates prior to the init hook, which obviously would no longer work and may result in an additional fatal error. If that's the case, and to ensure long-term portability, I would look into the Custom Taxonomies Codex page (along with other tutorials scattered about) and write your own small plugin that creates the custom taxonomies you need.

  3. Andrew Nacin
    WordPress Dev
    Posted 1 year ago #

    I would never recommend core-hacking in practice, but the other option would be to apply this patch, then aim to switch out this old plugin with a newer one (perhaps one you write) at a later time, before you need to upgrade again.

  4. fballoni
    Member
    Posted 1 year ago #

    Thanks Nacin,

    I've tried to change the custom-taxonomies.php code to have this working, but it didn't work. When I tried to activate the plugin, i've got this error:

    Fatal error: Call to undefined method stdClass::get_results() in .../wp-content/plugins/custom-taxonomies/custom-taxonomies.php on line 66

    I'm a client-side developer good with CSS, HTML and some JQUERY, but not good with php. But I can tell you that I've made right those two options that you gave me.

    I also don't like the idea to change the core. When I did apply the patch of the second option (just to test), The website worked, but I got this error accessing any dashboard page:

    Fatal error: Cannot redeclare inline_edit_term_row() (previously declared in /home/fballoni/freshdjsets/wp-content/plugins/custom-taxonomies/backwards_compatibility.php:77) in /home/fballoni/freshdjsets/wp-admin/includes/template.php on line 77

    I had to go back to normal and rename the custom-taxonomy plugin folder (to deactivate it) to have my admin running again.

    I would love to be able to make my own plugin for this, that access the database getting my custom taxonomies. But I'm not. :( Don't know how to start. I'll keep trying for some solution.

    If you have another one, please don't hesitate to tell me.

    Thank you and kind regards!

  5. fballoni
    Member
    Posted 1 year ago #

    anyone please help me! :-)

  6. waf1on1
    Member
    Posted 1 year ago #

    I have a related problem. i upgraded to wp 3.0 yesterday and immediately lost my top navigation bar. I checked my css and the code containing the top nav url is still there, however the navigation bar has no content in it. Any tips on fixing this would be most welcome. My site is http://www.womanafrique.com, using arras theme. Thanks guys...

  7. fballoni
    Member
    Posted 1 year ago #

    some other thing I can do about this??? please!?

  8. fballoni
    Member
    Posted 1 year ago #

    bump?

  9. fballoni
    Member
    Posted 1 year ago #

    Well,

    A nice guy found a solution for this! It worked well for me. I went to the database to see my custom taxonomies slogan to get them back, following his steps!

    http://nerdlife.net/custom-taxonomies/#comment-3206

    now everything is going like before. beautiful! thanks borg!

    Now you guys can see my website working. If you like electronic music and want to listen the best updated DJ Sets from all over the world, just go there! :-)
    http://www.freshDJSets.com

    cheers!

  10. 4levels
    Member
    Posted 1 year ago #

    @fballoni

    I got the same error as you

    Fatal error: Call to undefined method stdClass::get_results() in .../wp-content/plugins/custom-taxonomies/custom-taxonomies.php on line 66

    The issue is that the workaround wraps the call to initialize the taxanomies in a function, that is afterwards hooked to load.
    All you need to do is declare the $wpdb var as global at the start of your function:

    62. $custax_taxonomies = array();
    63. function custax_register_on_init() {
    64.   global $wpdb, $custax_taxonomies;
    65.   //build the list of custax objects
    66.   $wpdb->custom_taxonomies = $wpdb->prefix . 'custom_taxonomies';
    67.   $custax_taxes = $wpdb->get_results('SELECT * FROM '.$wpdb->custom_taxonomies);
    68.   if($custax_taxes) {
    69.     foreach($custax_taxes AS $custax_tax) {
    70.       $custax_taxonomies[$custax_tax->slug] = new custax($custax_tax);
    71.     }
    72.   }
    73. }

    You still need to apply the other 2 patches in the global taxonomies and posts php files.

    Too bad WP doesn't do proper error handling!

  11. eric
    Member
    Posted 1 year ago #

    Many thanks
    for your Help.
    Great!

Topic Closed

This topic has been closed to new replies.

About this Topic