WordPress.org

Ready to get started?Download WordPress

Forums

WordPress 3.5 - Error on Line 944 (40 posts)

  1. igmansfield
    Member
    Posted 1 year ago #

    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!

  2. Abhishek Ghosh
    Member
    Posted 1 year ago #

    Make sure :

    1. Your Webhost is running the required version of PHP.
    2. You have deactivated Cache Plugins, specially related to Database cache.
    3. You have deleted the cache.

  3. ichadwick
    Member
    Posted 1 year ago #

    Got a different error on mine. Automatic install of 3.5 screwed everything up, totally.

    Re-installed 3.4.2 and it seems to be fine. Might be the only viable solution for now.

    Think I'll wait for the inevitable 3.51 or 3.6 and all the bugs are ironed out.

  4. Abhishek Ghosh
    Member
    Posted 1 year ago #

    I installed 3.5 for my friend just few hours ago, its working fine :

    http://flinton.in/

    The domain and installation is new.
    I honestly got no error on update on mine. I was using 3.5 RC though on all production site except 1-2. There might be some plugin incompatibility, because I never keep any plugin active.

  5. igmansfield
    Member
    Posted 1 year ago #

    Thanks for the replies. I've tried reinstalling 3.4.2 but the error remains.

    Abhishek - how do I do the things you suggest?

  6. josbodewes
    Member
    Posted 1 year ago #

    I have exactly the same error as igmansfield.

    Fatal error: Call to a member function register_handler() on a non-object in /home/myusername/domains/mydomain.com/public_html/wp-includes/media.php on line 944

    I upgraded from 3.4.2 to 3.5 using the WordPress updater.

    I use PhP 5.3.10 and MySql 5.5.22 and Apache 2.2.22

    Before upgrading I made a copy. When I re-installed backup it still returns errors.

    I'm kinda stuck right now.

  7. themezoom
    Member
    Posted 1 year ago #

    I have the exact same error, no back up fixes it, no backwards re-install fixes it. I have yet to re-install the previous database.

    Please advise us as soon as possible what this error means. It is not a MYSQL or any other update issue as far as I can tell.

    - R

  8. themezoom
    Member
    Posted 1 year ago #

    I have the exact same error, no back up fixes it, no backwards re-install fixes it. I have yet to re-install the previous database.

    Please advise us as soon as possible what this error means. It is not a MYSQL or any other update issue as far as I can tell.

    Fatal error: Call to a member function register_handler() on a non-object in /homepages/42/d384486456/htdocs/chemtrailsfactorfiction/wp-includes/media.php on line 944

    - R

  9. pflorin
    Member
    Posted 1 year ago #

    I get a almost similar error except on line 903

    Warning: Invalid argument supplied for foreach() in /home/bodosp85/public_html/pocketdroid.net/wp-includes/media.php on line 903

    Line 903: foreach ( $taxonomy->object_type as $object_type ) {

  10. bnwilson6624
    Member
    Posted 1 year ago #

    I updated 10 sites and only one didn't take.

    Fatal error: Call to a member function register_handler() on a non-object in D:\Hosting\4363600\html\blog\wp-includes\media.php on line 944

    I did not deactivate plugins as instructed, which may be causing issue, and now I've locked myself out.

    I believe this is my only WP site hosted on GoDaddy. If any one finds a fix, please come back here and post your find.

  11. bnwilson6624
    Member
    Posted 1 year ago #

    FIXED!!
    1. I commented out lines 942-944 and 1073-1076 in wp-includes/media.php
    2. This gave me access to admin side of site, where I deactivated ALL plugins.
    3. I re-installed WP 3.5
    4. Reactivated plugins and now all is clean.

  12. themezoom
    Member
    Posted 1 year ago #

    Nice BNwilson, you cheeky coder!

    Thank you for sharing your solution!

    Yeah, my error was on 1 and 1 hosting which is equally challenging as Godaddy somtimes.

    Can you show us the lines you commented out precisely and how you coded it <snippet>?

    I would like to offer you a favor to use any one of my applications for free for some time, on me - this line helped me so much! Contact us any time at theme zoom dot com.

    - Russell

  13. apapership
    Member
    Posted 1 year ago #

    Thank you, bnwilson!!

    Although I have still other issue after following your direction, I can access to dashboard finally!!!

    This is my lines:
    942-945
    /* function wp_embed_register_handler( $id, $regex, $callback, $priority = 10 ) {
    global $wp_embed;
    $wp_embed->register_handler( $id, $regex, $callback, $priority ) ;
    } */

    1073-1077
    /* function wp_maybe_load_embeds() {
    if ( ! apply_filters( 'load_default_embeds', true ) )
    return;
    wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
    }*/

    After those corrections,
    I've got this error message on my pages:

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wp_maybe_load_embeds' was given in /home/a4527299/public_html/wp-includes/plugin.php on line 406

  14. dmc242
    Member
    Posted 1 year ago #

    BNWilson,

    Just wanted more clarification on how to do this.

    I updated all of my WordPress sites to 3.5 and now I can't even get into my control panel through the admin login. I did it though the Simple Scripts updater for all of my sites on Bluehost.

    The error message for every site reads:

    Server error
    The website encountered an error while retrieving http://www.242.org/. It may be down for maintenance or configured incorrectly.
    Here are some suggestions:
    Reload this webpage later.
    HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

  15. himynameiserik
    Member
    Posted 1 year ago #

    I get a almost similar error except on line 903

    Warning: Invalid argument supplied for foreach() in /home/zks/public_html/zelfklusshop.nl/wp-includes/media.php on line 903

    Line 903: foreach ( $taxonomy->object_type as $object_type ) {

    I'm seeing it is in my template.. becouse when i use the new twentytwelve it is solved. But what to do in this situation?

  16. Abhishek Ghosh
    Member
    Posted 1 year ago #

    If using any member's unofficial method works its well and good and you are lucky.

    Those who are still having issues, I will suggest to go back to the old last working version, that is 3.4.x for the most manually. Take a backup : Table by table SQL backup from PHPMyAdmin after optimizing the overheads plus the wp-content and important FTP files / folders.

    Test the backup in a test server by installing a new WP 3.4.2 (i.e. same version) and deleting and replacing the important Tables and FTP files. Do not activate any plugin. As on localhost we have the physical machine in hand we practically can test the backend visually. Now try to update to 3.5. It will probably take a database update (I am almost sure for some reason the problem happens in SQL update process and with cPanel, Plesk like webhosting control panel, another third party thing is in between and both are in new version and has bugs). Now take the backup and install on live server 3.5 freshly by deleting everything and installing 3.5. Restore the backup carefully (do not replace all th files).

    Those who have less idea about which SQL tables are important, read my old answer : http://wordpress.org/support/topic/migration-to-plesk-gone-wrong?replies=2#post-3506688

    Those who need a blank server for some reason (with IP only, no control panel, have to work with command line; can use HP Cloud or Rackspace Unmanaged as both has hourly charge).
    Also you can check with hotfix plugin - http://wordpress.org/extend/plugins/hotfix/
    (sounds bad like hotfix for Microsoft's most products, its difficult to say from the ratings whether it works, there is predominantly 5 star and 1 star).

    For 500 Error (LAMP server) check the php error log file. You can search this forum with 500 Error.

  17. missbackpacker
    Member
    Posted 1 year ago #

    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!

  18. bnwilson6624
    Member
    Posted 1 year ago #

    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

  19. Samuel Wood (Otto)
    Tech Ninja
    Posted 1 year ago #

    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.

  20. dodangtien
    Member
    Posted 1 year ago #

    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.

  21. esmi
    Forum Moderator
    Posted 1 year ago #

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

  22. hankinguyen
    Member
    Posted 1 year ago #

    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/

  23. Aprazeth
    Member
    Posted 1 year ago #

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

  24. rusmanarief
    Member
    Posted 1 year ago #

    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.

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

  26. rusmanarief
    Member
    Posted 1 year ago #

    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.

  27. 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. ;)

  28. Aprazeth
    Member
    Posted 1 year ago #

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

  29. boudewijnL
    Member
    Posted 1 year ago #

    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.

  30. samhagin
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.