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

Assigning variable with global scope inside function

 
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
ilyalyu
Smarty Regular


Joined: 03 Nov 2009
Posts: 72

PostPosted: Sun Nov 25, 2012 8:05 am    Post subject: Assigning variable with global scope inside function Reply with quote

Assigning variable with global scope inside function does not seem to work. The following code:
Code:
{function "f"}{$x=1 scope="global"}{/function}{f}{$x}

outputs nothing. I would expect it to output "1".
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sun Nov 25, 2012 3:57 pm    Post subject: Reply with quote

This is just an assignment it doen not output anything

Code:
{$x=1 scope="global"}{$x}
Back to top
View user's profile Send private message
ilyalyu
Smarty Regular


Joined: 03 Nov 2009
Posts: 72

PostPosted: Sun Nov 25, 2012 9:40 pm    Post subject: Reply with quote

Should not {$x} code output this variable?
And should it contain "1" value, since I called function {f}, which assigned $x=1 in global scope?
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Mon Nov 26, 2012 8:12 pm    Post subject: Reply with quote

This bug is now fixed in the SVN trunk.
The fix will later be included in 3.1.13
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