Types causing 500 error in admin-ajax.php
-
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(); } }
- The topic ‘Types causing 500 error in admin-ajax.php’ is closed to new replies.