WordPress.org

Support

Support » Installation » [Resolved] WordPress 3.4 : Update comes with Fatal Error

[Resolved] WordPress 3.4 : Update comes with Fatal Error

  • Hi everyone,

    i was excited about updating to wordpress 3.4 but during the update, i got this fatal error :

    Fatal Error : Call to a member function add_rewrite_tag() on a non-object in /wp-includes/rewrite.php line 51;

    Don’t really know what to change there, i don’t want to tweak the core files at each installation !

    Tell me if you got some ideas about this problem or if there is a hotfix for this soon !

Viewing 9 replies - 1 through 9 (of 9 total)
  • 1) I’ve commented the add_rewrite_tag function call.
    2) New fatal error : same file, with function add_permastruct, line 74 (also commented out)
    3) WordPress works …

    I’m looking around admin pages and i found these errors :

    4) Page Media -> Notice: Trying to get property of non-object in /wp-includes/capabilities.php on line 1022 , 1023 , 1026 ( I’m using the Debug Mode )

    All I got from now. I was using custom plugins that i’ve developped. Remove everything and I still got those errors.
    Wordpress is installed locally using Mamp with php 5.3.6. No permalink structure were used.

    “Cheatin uh?” error message when trying to upload docs(or logos for ex) on theme. I had to uninstall and reinstall old WP version for this to work properly. I hope this is fixed asap.

    For those having the same problem with rewrite.php, add the conditionnal around the method call, it is a temp solution :

    Line 51 :
    if(is_object($wp_rewrite)){
    $wp_rewrite->add_rewrite_tag( $tag, $regex, $query );
    }

    same for add_permastruct line 74:
    if(is_object($wp_rewrite)){
    return $wp_rewrite->add_permastruct( $name, $struct, $args );
    }

    Ok it is one of the plugin that breaks wordpress 3.4, fresh installation of 3.4 works perfectly.

    So my question is: when occurs a call to functions loike add_rewrite_tags and add_permastruct ?

    The plugin generates a custom post type.

    NOTICE I’m still getting errors in the Media page, try to access properties of a non-object

    The problem is from the taxonomies for the custom post type, are there changes in the way to create custom taxonomies ?

    SOLUTION FOUND:
    The plugin was registering taxonomies without using the ‘init’ hook. ALWAYS use hooks to register taxonomies -> read the docs carefully !

    Use add_action(‘init’, ‘callback_func’) for registering taxonomies ! WordPress rules !

    Now i’m really excited about the new features in wordpress 3.4 ! Keep the good work !

    Damn i hate bugs !

    open media-upload.php from admin folder.
    goto line# 125
    remove line#125 and replace it with below
    if ( ! empty( $_REQUEST[‘post_id’] ) && current_user_can( ‘edit_post’ , $_REQUEST[‘post_id’] ) )

    don’t change line#126 ..
    and start uploading from front end..:)

    I have tried all the above fixes and nothing seems to be working… I am not making a plugin, I just have a section of posts…. I want to rewrite the URLS – I have also deactivated all plugins and this still didnt solve the issue…. any suggestions?

    esmi

    @esmi

    Forum Moderator

    open media-upload.php from admin folder.

    No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] WordPress 3.4 : Update comes with Fatal Error’ is closed to new replies.
Skip to toolbar