WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [closed] WordPress 3.4 : Update comes with Fatal Error (10 posts)

  1. Julien
    Member
    Posted 2 years ago #

    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 !

  2. Julien
    Member
    Posted 2 years ago #

    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.

  3. Sean
    Member
    Posted 2 years ago #

    "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.

  4. Julien
    Member
    Posted 2 years ago #

    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 );
    }

  5. Julien
    Member
    Posted 2 years ago #

    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

  6. Julien
    Member
    Posted 2 years ago #

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

  7. Julien
    Member
    Posted 2 years ago #

    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 !

  8. crazy.adeel
    Member
    Posted 2 years ago #

    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..:)

  9. onei0120
    Member
    Posted 1 year ago #

    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?

  10. esmi
    Forum Moderator
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic