All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Undefined property: EE::$TMPL

Scott Jones 9 Aug 2012 12:39 problem, complete

HI I am writing a custom module for my work place and we use the Low Variables module (which is awesome)
however the error i am getting is as follows:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: EE::$TMPL

Filename: low_variables/mod.low_variables.php

Line Number: 362

Fatal error: Call to a member function fetch_param() on a non-object in {file_system}/third_party/low_variables/mod.low_variables.php on line 362

It seems to be loosing the EE super object?

my extension is running a hook to update the global vars/snippets.

Replies

  1. Scott Jones 9 Aug 2012 12:39

    FYI im using EE v2.5.2 and low variables v2.3.0

  2. Low 9 Aug 2012 14:46

    As you might guess, I cannot replicate this.

    Are you sure you're not overwriting the EE super object with something else?

  3. Scott Jones 9 Aug 2012 15:40

    HI,

    Yeah i thought it might be a tough one. It might be worth sending you my code for the extension (it basically loads the EE template library, loads the Global Vars/snippets and for each snippet/GV parses it through the template library in order to allow the user to have module code in the snippets, eg {exp:module:function})

    I can send the code but the basics are as follows:

     
    $this->EE =& get_instance();
    $this->EE->load->library('Template');
    foreach($this->EE->config->_global_vars AS $key => $val)
    {

    $this->EE->config->_global_vars[$key] = $this->EE->template->parse($val);
    }


    as you can see not a lot going on. i am running this as an extension though bu i cant see that im overwriting the EE super object..

  4. Low 10 Aug 2012 08:59

    Do you need to load the Template library? Isn't it already loaded? That might cause some issues, perhaps.

  5. Scott Jones 10 Aug 2012 10:41

    If i take out the template loading then it crashes at the start..i am using the following hook point: core_template_route

  6. Low 10 Aug 2012 10:47

    What if you load it like this:

    $this->EE->load->library('Template', 'TMPL');


    ...and then use $this->EE->TMPL in your addon.

  7. Scott Jones 10 Aug 2012 12:39

    hmm although that should have worked it was giving me an error:
    undefined EE:TMPL

    will take a look into it.