• I am running Types v2.2.18 with the Genesis framework from StudioPress v2.5.3 and PHP v5.4.24. After some theme and plugin updates, I started getting a 500 in admin-ajax.php. The plugin was still working fine but ajax plugin updates, media library, etc. were not. Checking the logs I got the following error.

    PHP Fatal error: Call to a member function register_callbacks() on a non-object in /home/mysite/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/inc/toolset.ajax.class.php on line 70

    I disabled all other plugins to confirm that it wasn’t a conflict with another plugin and the error still persisted, I then switched themes and the error was still there.

    Digging into the code showed that

    final public static function get_instance()

    was returning false which I was able to solve by changing the initialize function to check if the instance exists before calling the functions.

    However, this is hiding the problem, not fixing it and it isn’t upgrade safe. Can you shed some light on this?

    public static function initialize() {
    	$instance = self::get_instance();
            
            //this is the added line
    	if($instance)
    	{	
    		$instance->register_callbacks();
    		$instance->additional_ajax_init();
    	}
    }
    • This topic was modified 6 years, 5 months ago by zrerkkil.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Beda

    (@bedas)

    I’m unable to replicate this.

    I will need to get a copy of this site. Can you send me a Site’s Snapshot in the forum at Toolset, where I can enable private replies?
    https://wp-types.com/forums/forum/general-and-pre-sales-questions/

    A subscription for that Fortum is free and can be done here:
    https://wp-types.com/support/register/

    Thank you!

    I am also getting a 500 in admin-ajax.php on a client’s site… the plugin is working fine but ajax plugin updates, media library, etc. are broken with 500 errors in the browser console repeatedly. Latest version of WP, only 4 other basic plugins installed.

    I tested versions v2.2.17 through v2.2.21, and the 500 AJAX errors occur. I tried installed v2.2.22 but it white-screened the site! Error:
    Parse error: syntax error, unexpected T_FUNCTION in /home/content/03/6999803/html/wp-content/plugins/types/vendor/toolset/types/embedded/admin.php on line 395

    I rolled back to v2.2.16 and the AJAX errors stopped happening, so I’m using that version for now.

    Thread Starter zrerkkil

    (@zrerkkil)

    Looks like I have the identical issue as Rob, white screen on 2.2.22, the error I mentioned on v2.2.17 through v2.2.21 so I am hanging out on v2.2.21 with the fix I mentioned before. Sorry for the late reply as well Beda, I should be able to register and get you more information next week

    Plugin Support Beda

    (@bedas)

    Hello @presswizards and @zrerkkil

    I and other users have 2.2.22 instaled and do not get a PHP error or white screen like yours.
    It means that this most likely is a server issue or compatibility issue with a plugin that you both use, eventually.

    Unfortunately here in this forum, I cannot ask you to send me either log in details or a copy of the site, so I could analyse this.
    But in our Free Types Forum, we can do that.
    You will need to register, it’s free.

    Please contact us there, so we can be sure to solve this!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Types causing 500 error in admin-ajax.php’ is closed to new replies.