Skip Navigation

Error “Call to a member function get() on a non-object” when using Types with certain themes

Resolved

Reported for: Toolset Types 2.2.16

Resolved in: Toolset Types 2.2.17

Topic Tags: Types plugin

Symptoms

Some themes are missing the information required by WordPress, which causes the wp_get_theme() function to return an invalid value. Types 2.2.16 doesn’t expect such an issue and it produces this error.

Workaround

This will be fixed in the following version of Types.

In the meantime, you can download this file, extract it and replace:

  • mediator.php file in application/controllers/interop/ folder

10 thought on Error "Call to a member function get() on a non-object" when using Types with certain themes

  • It did’nt help me, just made another error.

    I’m using the Make theme and now my site are down 🙁

    I’m getting this error after replacing mediator.php

    Fatal error: Call to a member function get() on boolean in /var/www/skbgym.dk/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/compatibility-loader/toolset.layouts-themes-factory.class.php on line 24

    • Hello Steve, I’m sorry that you are still experiencing issues, and thank you for the details. We are going to fix the issue as soon as possible and get back to you.

      • I believe we have a fix. However, it couldn’t be properly tested, because we couldn’t reproduce the issue (tried with the Make theme but without any visible errors).

        Could you please download the link below and overwrite the “wp-content/plugins/types/vendor/toolset/toolset-common/inc/autoloaded/compatibility-loader/toolset.layouts-themes-factory.class.php” with the one from the ZIP archive?

        https://toolset.com/wp-content/uploads/2017/09/toolsetcommon-261.zip

  • Did not fix my error.

    Fatal Error: Call to undefined method WPV_Settings::get_instance() in /home/acisales/public_html/wp-content/plugins/types/vendor/toolset/toolset-common/inc/toolset.settings.class.php on line 177)

    Thanks for the suggestion.

    • Hi Joshua

      Thanks for the feedback. We could not replicate this issue, and we do not think it is related to this errata.

      Would you mind to open a support ticket about it with some extra information about theme and plugins used on your site? It will help us track this down and provide a solution.

      Thanks in advance.

  • Did not fix my error either. I downloaded and replaced both files. It still shows the same error. It’s a Storefront child theme.

    • Hello Joanna, thank you for the feedback. Do you see the same message as before, or is it different after applying the patch?

  • This same problem happened with my site.

    As hardcore PHP coder and member of Finland WordPress team I little bit studied this. Problem is if theme and/or child-theme do not load correctly. Code in “mediator.php” assumes it loads and continues after unsuccessful situation. In function “get_theme_slug( )” code uses WordPress function “wp_get_theme()” which return WP_Error if theme is not ok. System hould inform end-user in this situation.

    My own problem and solution was, that theme directory had not sufficient rights which web-server process needs. After rights adjustment theme loads ok and Toolset code worked ok.

Comments are closed