Hi,
I have noticed an annoying problem since we upgraded to 2.4.
We use a series of configuration global variables for our sites (ie: language_code, current_language, video_169_width, video_169_height, etc). As we are lazy/organized, we have placed all that kind of ‘external’ global vars in the index.php in the $assign_to_config[‘global_vars’] array.
That was working great until the upgrade to 2.4. Those variables are only parsed in the template, but not in a plugin tag (for instance). So if I call {language_code} in the template, no problem, it is outputted, but if I call {exp:channel:entries search:video_langage="{language_code}”} it is not working anymore.
I first noticed the problem with one of my plugin. So I digged a bit and noticed that the method parse_globals() of Template class is not parsing those global vars at all.
Before the upgrade, to output the result of my plugin, I was doing something like:
$this->return_data = $this->_ee->TMPL->parse_variables($this->_ee->TMPL->tagdata, $this->_fetch())and the ‘external’ global vars was parsed. Now, I have to do that:
$result = $this->_ee->TMPL->parse_variables($this->_ee->TMPL->tagdata, $this->_fetch());
$this->return_data = $this->_ee->TMPL->parse_variables($result, array($this->_ee->config->_global_vars));I hate patching the code that way but it was the only quick way I found.
So (finally 😊 ) is it a bug? Is it the normal way to do? What happened?
Thanks in advance for you time!
Cheers,
Pv