Support » Plugin: WP Ultimate Recipe » Error: Call to a member function get_template() on boolean

  • Resolved kdub1312

    (@kdub1312)


    Hi Brecht,

    I’m receiving the following error message:

    ‘CRITICAL Uncaught Error: Call to a member function get_template() on boolean ( wp-ultimate-recipe.php:263 )’

    I have looked thru the plugin files, and I see where this method is defined on the WPUltimateRecipe class, but I have had no luck determining where it’s getting called from. The declaration is this line:

    public function template( $type, $template )
        {
            return $this->addon( 'custom-templates' )->get_template( $type, $template );
        }

    I’ve also not been able to locate any place in the files that ‘custom-templates’ is defined. I believe it may not be defined at all, causing addon() to evaluate to ‘false’ and throwing the error. Could this be the case?

    The error does not seem to be effecting site performance, however I would like to resolve it as it will better allow me to address some other plugins that are adversely effecting my site.

    Any help is greatly appreciated

    Regards,

    Kevin

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Brecht

    (@brechtvds)

    Hi Kevin,

    Addons are automatically loaded from the /addons/ folder. “custom-templates” should definitely be in there or your recipe template wouldn’t be working without custom code.

    When are you getting this error exactly?

    Kind regards,
    Brecht

    Thanks for the quick reply Brecht. Well, The error gets thrown once or twice a day generally, however I don’t yet know what specific action is being taken to trigger it, if that’s what your asking.

    I do see custom-templates.php within the /addons/ folder, however in that file or any around it I’ve not been able to find a call to the template() function defined in the WPUltimateRecipe class. My thought is if I could locate that call I might be able to identify where the error is getting thrown from and in turn what action is triggering it

    Plugin Author Brecht

    (@brechtvds)

    Do you have the full call stack or just that one line?

    just that one line. That message is from my admin dashboard, so when I get back to my machine I’ll check the debug.log file and see if it has any further stack info not being outputted to admin and follow up

    no further stack info :-/

    Plugin Author Brecht

    (@brechtvds)

    Do you happen to be using our Minimal Mode?

    I am actually, I have minimal mode activated for any of the higher traffic pages that don’t utilize wpurp- the front page, ‘product’, ‘cart’, etc

    Plugin Author Brecht

    (@brechtvds)

    Definitely related. A page that’s on minimal mode basically doesn’t load the assets and the addons for performance reasons.

    So it looks like something is trying to display a recipe on a page that has minimal mode enabled.

    Brecht

    gotcha, that makes sense. I think that gets me to the root of the issue. I’ll mark this resolved as the minimal mode is triggered by an mu-plugin I created, so I’ll need to troubleshoot my custom code from here.

    Thanks for the great support!

    Regards,

    Kevin

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Error: Call to a member function get_template() on boolean’ is closed to new replies.