[fixed] module plugin load wrongly triggers smarty error

The members of the Dev team will place issues here that they consider to be solved.
Post Reply
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

[fixed] module plugin load wrongly triggers smarty error

Post by Foaly* »

When I install ListItExtended git version on cmsms' second beta version an error occurs using the module tag: "Unknown tag ListIt2". Nevertheless the tag's output is shown beneath.

Appearently smarty_core_load_plugins() is called two times. What happens: The first time it's called, ListIt2 isn't in $smarty->_plugins. smarty_core_get_module_plugin() loads it some lines below, but for some reasons or the other the function returns false. That's why $_noadd won't be set to true and the error will finally be triggered.

What's even more confusing to me is the fact that it works when I drop the & from $_plugin = &$smarty->_plugins[$_type][$_name];
IMHO it's not needed, but I can't connect the dots.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: module plugin load wrongly triggers smarty error

Post by Rolf »

Hi Foaly*

This should be fixed in SVN. You used an SVN version or a beta package?

Grt. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: module plugin load wrongly triggers smarty error

Post by Foaly* »

Hi Rolf,

it works with rev 7391. thanks.
uniqu3

Re: [fixed] module plugin load wrongly triggers smarty error

Post by uniqu3 »

This was fixed but it looks like something was changed again.
CG did some changes to /lib/classes/class.CMSModule.php where at that point my issues with ListIt2 were solved and was working.
But now when i clear cache issues are back, as example ListIt2 and MleCMS modules (according to commits SVN version of MleCMS was prepared for 1.10) i get these errors:

Clear cache and open frontend gives me this error related to MleCMS:

Code: Select all

Fatal error: Call to a member function function_plugin() on a non-object in D:\Localhost\www\1.10.x\tmp\templates_c\%%52^52E^52E7C88B%%tpl_top%3A22.php on line 5
Output of tpl_top on line 5

Code: Select all

<?php $this->_cache_serials['D:\Localhost\www\1.10.x\tmp\templates_c\%%52^52E^52E7C88B%%tpl_top%3A22.inc'] = 'da3fbe989c3ccfb28bf5245f44f9aa6d'; ?><?php if ($this->caching && !$this->_cache_including): echo '{nocache:da3fbe989c3ccfb28bf5245f44f9aa6d#0}'; endif;$_cache_attrs =& $this->_smarty_cache_attrs('da3fbe989c3ccfb28bf5245f44f9aa6d','0');echo $this->_plugins['function']['MleCMS'][0][0]->function_plugin(array('action' => 'init'), $this);if ($this->caching && !$this->_cache_including): echo '{/nocache:da3fbe989c3ccfb28bf5245f44f9aa6d#0}'; endif;?>
Then hiting refresh i see another error related to ListIt2:

Code: Select all

Fatal error: Call to a member function function_plugin() on a non-object in D:\Localhost\www\1.10.x\tmp\templates_c\%%76^763^76313DB0%%tpl_body%3A22.php on line 90


Output of tpl_body on line 90:

Code: Select all

<?php if ($this->caching && !$this->_cache_including): echo '{nocache:30603d305a1b644fb336f781e9ce0fe3#17}'; endif;$_cache_attrs =& $this->_smarty_cache_attrs('30603d305a1b644fb336f781e9ce0fe3','17');echo $this->_plugins['function']['ListIt2'][0][0]->function_plugin(array(), $this);if ($this->caching && !$this->_cache_including): echo '{/nocache:30603d305a1b644fb336f781e9ce0fe3#17}'; endif;?>
Hiting refresh again, shows working module on Frontend.
Post Reply

Return to “Closed Issues”