Support » Fixing WordPress » WordPress 3.5 – Error on Line 944

  • I’ve just downloaded WordPress 3.5 and am getting the following error on all pages of my website (including wp-admin):

    Fatal error: Call to a member function register_handler() on a non-object in /websites/123reg/LinuxPackage21/ig/ma/ns/igmansfield.co.uk/public_html/wordpress/wp-includes/media.php on line 944

    Can anyone help? I’ve tried doing a manual upgrade but with no result.

    Thank you!

Viewing 15 replies - 16 through 30 (of 39 total)
  • Hi bnwilson6624!

    For non-PHP wizards like me, what are the exact codes you used for lines 942-944 and 1073-1076 in wp-includes/media.php?

    TIA!

    Upfront comments: 1)I am not a PHP coder and know just enough to be dangerous – use this at your descretion. 2) I should have uninstalled all plugins (especially Cache ones) before install. 3) make a copy of file before you mess with it.4) My goal was to get access to try a 2nd install of the 3.5 update.

    My error pointed at line 944 in media.php. Original code was:

    /**
    * Register an embed handler. This function should probably only be used for sites that do not support oEmbed.
    *
    * @since 2.9.0
    * @see WP_Embed::register_handler()
    */
    function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
    global $wp_embed;
    $wp_embed->register_handler( $id, $regex, $callback, $priority );
    }

    I moved */ from line 941 to line 946, which comments out 942-945.

    After trying to access admin, I rec’d the same type of error for line 1076. Again I moved 8/ from 1072 to 1078.
    This time I was successful in getting the admin to open, although I still had error messages. I deactivated all of the plugins and (re) updated to 3.5. All seems in order now. Media.php is back in it’s proper state and site seems to be working correctly.

    My hunch is that one of the plugins ‘got in the way’ of a clean install of 3.5. When the instructions tell you to backup files and deactivate plugins before update… I should listen.

    Good Luck,
    Ben

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Yes, deactivating plugins is indeed an important step.

    If you want to deactivate all your plugins immediately, you can rename the wp-content/plugins directory. This will force deactivate all plugins when you visit the admin pages. Then you can rename the directory back and try to figure out which plugin is causing the problem.

    Hi, anyone knows the solution. I have exactly the same problem with the owner of this topic. I did many ways to get rid of it, but no method worked. I did the same method as bnwilson6624 (thank you bnwilson6624 for your instruction), but it did not work unluckily. Hopefully someone can fix it soon. I cannot come back to 3.4.2 because I deleted the WordPress file 3.4.2 a month ago.

    As per the Forum Welcome, please post your own topic. Your problem – despite any similarity in symptoms – is likely to be completely different.

    I got error when upgrade to 3.5. There is a mistake with headline. Plz help me

    This is demo
    http://imageshack.us/photo/my-images/20/loiheadline.png/

    Upfront: I am no coder, developer or anything of the sorts.

    How I fixed it was:

    1. Used BNWilson6624’s method of editting media.php
    2. Logged in to (a funky looking) admin-panel
    3. Deactivated ALL plugins
    4. Reinstalled WP 3.5 from the admin-panel
    5. Noticed it was still broken
    6. Renamed plugins directory
    7. Cleared out browser cache (CTRL+SHIFT+DEL, and set to 1 hour)
    8. Logged in to a working admin panel, with some error still showing.
    9. Uploaded correct/normal media.php
    10. Errors now gone.
    11. Now to reactivate the plugins…

    Guys, I tried this and it works. But I’m not sure what else that I might break:

    1. go to wp-includes/default-filters.php line 248
    2. comment that line
    add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 );

    And you can leave media.php as well as plugin.php as it is.

    Moderator Jan Dembowski

    (@jdembowski)

    Brute Squad and Volunteer Moderator

    That’s really poor advice as you should never modify code that ships with WordPress.

    If you have to do that (I personally think that’s not a good idea) then via a small plugin or your theme’s functions.php file just use

    remove_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 );

    And that should take care of that for you.

    If it doesn’t then reply back here. That line may need to be hooked into init.

    yeah, it’s only a temporary (and a quick dirty) fix.

    When the next wordpress update comes, revert it back and pray that this time the problem is fixed.

    p/s: remove_action in a theme file indeed is a (relatively) cleaner fix. It should work.

    Moderator Jan Dembowski

    (@jdembowski)

    Brute Squad and Volunteer Moderator

    p/s: remove_action in a theme file indeed is a (relatively) cleaner fix. It should work.

    Yes. That’s why actions and filters are among my favorite WordPress toys. 😉

    Thank you rusmanarief and Jan Dembowski for your explanation 🙂

    I agree that one should never have to modify the core WordPress files.

    Yet, once you have upgraded your site and it no longer loads – what else is there to do? In my case I couldn’t access my site nor the admin-panel at all, and the only way to get it to work was by doing just the above.

    Again, I agree that it should never be necessary – which is why it might be a good idea to have WordPress disable all plugins directly after an update, and revert to a default/safe theme. Call it a fail-safe upgrade system perhaps, but it would help prevent these issues as some of us have experienced.

    Again, my thanks for everyone’s help and assistance – I learned something from it all 🙂

    Good news, I seem not to be the only one with this problem.

    Bad news, none of the suggested solutions seem to work for me.
    Bad news 2, my site is now completely locked down.
    Bad news 3, It seems that testing is not done by the WordPress team.
    Bad news 4, it looks like “backward compatibility” is a dream from the past.
    Bad news 5, In spite of my attempts to contact even Matt Mullenweg I cannot get a reply back.

    “Code is Poetry”? to me it seems living hell these days. Upgrading to 3.5 was the worst thing I ever did.

    In my case, just re-installing the core WordPress files resolved the issue. It is possible some files were not updated during the automatic upgrade process and manually re-uploading the 3.5 files after downloading and unzipping from http://wordpress.org/download/ fixed it.

    FIXED— I had a similar issue (media.php error) while trying to do a manual upgrade from 3.2.1 to 3.5. after several attempts to revert back to 3.2.1 ad i could not, i took the bull by the horn.

    I suspected that wordpress 3.5 has a bug issue (thats for code wizards to sort, i downloaded wordpress 3.4.2.

    uploaded it to my wordpress folder and replacing wp-admin and wp-includes.

    I checked to see that all files i uploaded with 3.5 are deleted.

    next i point my browser to mysite/wp-login/upgrade.php

    i got a class them error this time.

    next i copied wp-settings into my wordpress installation folder overwriting what was there.

    them i cleared by browser cache ctrl + shift + del

    and reload mysite/wp-login/upgrade.php and boom! my site was upgraded to 3.4.2.

    I will stick with that for a while cause my site http://nigeriaoilandgasjobs.com was down for 3days becuase i wanted to upgrade to wordpress 3.5

    I had to give something back because i learnt alot from your posts

Viewing 15 replies - 16 through 30 (of 39 total)
  • The topic ‘WordPress 3.5 – Error on Line 944’ is closed to new replies.