Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Plugin used in included subtemplate compiles incorrectly

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
Synchro
Smarty Regular


Joined: 27 Apr 2008
Posts: 43

PostPosted: Tue Apr 28, 2015 8:43 am    Post subject: Plugin used in included subtemplate compiles incorrectly Reply with quote

I've now run into another issue that might be related to the bug I reported yesterday. I have a custom plugin for creating markup for gravatar images. This has been working fine for years (including in 3.1.21), but is now not working in HEAD when loaded from composer, and the compiled template code makes no sense. The template markup is:
Code:
{gravatar email=$emailaddress rating="pg" size=20 default="identicon"}

This resulting compiled template contains this nonsensical code:
Code:
if (!is_callable(array('smarty_function_gravatar','smarty_function_gravatar'))) require_once '';

The plugin itself is a completely standard global function, not a class method or anything, with a normal signature:
Code:
function smarty_function_gravatar($params, &$smarty) {

So there are two problems here - it's checking to see if smarty_function_gravatar is a method of the smarty_function_gravatar class (which doens't exist), then trying to require an empty string.

There are other custom function plugins in this same template loaded from the same folder that do not have this problem.

The only thing I can see that's different about this one is that it's called from inside an included subtemplate, much as in yesterday's bug report, and in an almost identical manner, if I move the plugin up into the containing template, it works and compiles sensibly. In fact the plugin itself works in both locations, it just seems that the require line is only written correctly if the plugin is used in the containing template too.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Apr 28, 2015 9:14 pm    Post subject: Reply with quote

This bug was introduced by yesterdays fix. Sorry it was too late at night at my place....

It's now fixed on github
Back to top
View user's profile Send private message
Synchro
Smarty Regular


Joined: 27 Apr 2008
Posts: 43

PostPosted: Tue Apr 28, 2015 9:18 pm    Post subject: Reply with quote

Thanks, that fixed it.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP