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

Smarty 3: {assign} doesn't assign to smarty.session

 
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
monoxide
Smarty n00b


Joined: 31 Oct 2009
Posts: 4

PostPosted: Fri Nov 27, 2009 8:50 am    Post subject: Smarty 3: {assign} doesn't assign to smarty.session Reply with quote

I have the following code that I'm 90% sure used to work (in Smarty 3).

Code:

{if not empty($smarty.session.errors.comment)}
<div class="error">{$smarty.session.errors.comment}</div>
{assign var='smarty.session.errors.comment' value=''}
{/if}


This isn't assigning anything, even locally. If I change it to:

Code:

{if not empty($smarty.session.errors.comment)}
<div class="error">{$smarty.session.errors.comment}</div>
{assign var='smarty.session.errors.comment' value=''}
{$smarty.session.errors.comment}
{/if}


It prints out twice. Is this a bug, or is it something that changed at some point?
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Nov 27, 2009 12:51 pm    Post subject: Reply with quote

If you read the special Smarty variable $smarty.session the PHP $_SESSION variable gets accessed. This is readonly. You can't write to it. This never has been possible.
Back to top
View user's profile Send private message
monoxide
Smarty n00b


Joined: 31 Oct 2009
Posts: 4

PostPosted: Fri Nov 27, 2009 8:40 pm    Post subject: Reply with quote

I'm pretty sure it worked at some point in 3.0a, but it might have been a bug at that point... Oh well, time to rethink how I'm doing this then.
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