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 RC1 Released
Goto page 1, 2  Next
 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Apr 30, 2010 2:13 am    Post subject: Smarty 3 RC1 Released Reply with quote

The first RC1 of Smarty 3 has been released! Please join the developer mailing list and see the Smarty 3 section of the forums and give us feedback!

NOTE: Documentation for Smarty 3 is still being finalized, please use the README for now.

http://www.smarty.net/


Last edited by mohrt on Thu Jul 15, 2010 7:55 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
m-g
Smarty Rookie


Joined: 12 Jan 2010
Posts: 6
Location: Germany

PostPosted: Fri Apr 30, 2010 5:34 am    Post subject: detailed version information Reply with quote

A method returning detailed version information would be great. It should report the major, minor (int) version and patch (int or string) level.
Code:
(2.6.26    -> major=2, minor=6, patch=26)
 3.0.Beta8 -> major=3, minor=0, patch=Beta8
 3.0 RC1   -> major=3, minor=0, patch=RC1
 3.0.0     -> major=3, minor=0, patch=0

So it would be much easier to make needed code specific changes during the migration phase of v2 up to v3.
Back to top
View user's profile Send private message
moneysack
Smarty Rookie


Joined: 25 Mar 2010
Posts: 10
Location: Hamburg

PostPosted: Fri Apr 30, 2010 9:04 am    Post subject: Reply with quote

There is a mistake in sysplugins/smarty_internal_config.php on line 175:

Code:

$this->mustCompile = ($this->smarty->force_compile || $this->smarty->compile_check && $this->getCompiledTimestamp () !== $this->getTimestamp ()):


The getCompiledTimestamp() method will (on many systems) always return a Timestamp that is newer than the Timestamp returned from the method getTimestamp().

It works much better with the following line:
Code:

$this->mustCompile = ($this->smarty->force_compile || $this->smarty->compile_check && $this->getCompiledTimestamp () < $this->getTimestamp ()):


EDIT:
This is much the same Code as in sysplugins/smarty_internal_template.php on the Lines 185-187
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


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

PostPosted: Fri Apr 30, 2010 1:13 pm    Post subject: Reply with quote

This has been updated in the SVN.

Danke
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Apr 30, 2010 9:21 pm    Post subject: Reply with quote

Template functions definded by the {function} tag like

{function name=foo parameter....}
....
{/function}

could be called in the past like a standard tag

{foo parameter....}

However template functions defined in subtemplates or forward reference
did require the {call} tag to call the tamplate function like

{call name=foo parameter....}

To avoid ambiguity decission was made that it is madátory to use the {call} tag in all cases for calling template functions.

This change is effective now in the current SVN version (after the release of RC1)
Back to top
View user's profile Send private message
moneysack
Smarty Rookie


Joined: 25 Mar 2010
Posts: 10
Location: Hamburg

PostPosted: Fri May 14, 2010 1:24 pm    Post subject: Reply with quote

There is one more Bug in the Method mustCompile() of libs/sysplugins/smarty_internal_config.php:

Currently if the Config file doesn't exists and the Variables compile_check and force_compile are set to false, then mustCompile won't return true.

The Line 175 had to look like this:

Code:

$this->mustCompile = ($this->smarty->force_compile || $this->getCompiledTimestamp () === false || ($this->smarty->compile_check && $this->getCompiledTimestamp () < $this->getTimestamp ())):


Now mustCompile is set to true if the Method getCompiledTimestamp is returning false.

This is another snippet that i copied from smarty_internal_template.php Wink
Back to top
View user's profile Send private message Visit poster's website
U.Tews
Administrator


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

PostPosted: Fri May 14, 2010 1:47 pm    Post subject: Reply with quote

Thanks for bringing it up. The fix is in the SVN now.
Back to top
View user's profile Send private message
andrethehook
Smarty n00b


Joined: 14 May 2010
Posts: 1

PostPosted: Fri May 14, 2010 9:40 pm    Post subject: setC Reply with quote

Hi,

after upgrading from beta8 to rc1 i get the following error:

Quote:
Fatal error: Call to undefined method Smarty::setTemplateDir() in /var/www/development/index.php on line 5


The line in question is

Quote:
$smarty->setTemplateDir(INC_DIR . 'templates');


What have I missed? It worked fine on beta8.


A
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri May 14, 2010 9:57 pm    Post subject: Reply with quote

Nothing has been changed there. It does work in my place.
Back to top
View user's profile Send private message
SIR JEDI
Smarty n00b


Joined: 27 May 2010
Posts: 1

PostPosted: Thu May 27, 2010 12:59 pm    Post subject: Reply with quote

There is some bug in handling parameters to user custom functions.

For example in smarty 2 I can do sth like this:

Code:
{imageUrl type='productGfx' width=$skin_settings->$settingsgroup->imgwidth image=$product->mainImageName() overlay=1}


but in smarty 3 there is error in handling parametrized get calls

Code:
$skin_settings->$settingsgroup->imgwidth


This is compiled to sth like this:

Code:
'width'=>$_smarty_tpl->getVariable('skin_settings')->value->{$_smarty_tpl->getVariable('settingsgroup')->value->imgwidth}


and it should be (changed location of '}'):

Code:
'width'=>$_smarty_tpl->getVariable('skin_settings')->value->{$_smarty_tpl->getVariable('settingsgroup')->value}->imgwidth
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Thu May 27, 2010 4:01 pm    Post subject: Reply with quote

This was a bug in chained objects using variable properties.

The fix is in the SVN now
Back to top
View user's profile Send private message
grmbl
Smarty Rookie


Joined: 12 Jan 2010
Posts: 7

PostPosted: Tue Jun 01, 2010 10:54 am    Post subject: Reply with quote

There seems to be a problem with functions in parent templates:

wrapper.html:
Code:
{function name=info_guides}...some code...{/function}{block name='content'}&nbsp;{/block}


child.html:
Code:
{extends file='wrapper.html'}
{block name='content'}{call name=info_guides}...code...{/block}


Throws PHP warning:
Code:
PHP Warning:  Invalid argument supplied for foreach() in /***/libs/sysplugins/smarty_internal_compile_call.php on line 53
PHP Warning:  Invalid argument supplied for foreach() in /***/libs/sysplugins/smarty_internal_compile_call.php on line 53" while reading response header from upstream...


SVN version updated 15 minutes ago.

EDIT: It seems it is not because of child templates' call, throws exception when there're no call to function in child templates. Function are defined with usual {function name=blah} in parent, no parameters. Worked nice before RC1.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Tue Jun 01, 2010 5:12 pm    Post subject: Reply with quote

THe bug when using template functions and templatze inheritance is fixed in the SVN now.
Back to top
View user's profile Send private message
grmbl
Smarty Rookie


Joined: 12 Jan 2010
Posts: 7

PostPosted: Tue Jun 01, 2010 7:42 pm    Post subject: Reply with quote

U.Tews wrote:
THe bug when using template functions and templatze inheritance is fixed in the SVN now.


Hey, thanks for the fix!

No warnings now, seems to be working OK.
Back to top
View user's profile Send private message
prdatur
Smarty n00b


Joined: 12 Jun 2010
Posts: 2

PostPosted: Sat Jun 12, 2010 9:54 pm    Post subject: modifier date_format Reply with quote

Hello,

I upgraded our beta project now from v2 to v3 rc1.
After i did this, i needed to change a lot of things Smile
but i found something that i think it might be a bug.

i used a lot of time the modifier date_format, but now it tells me that the modifier date_format is not in my secure_modifier, if i add this modifier it tells a php error that date_format needs 2 parameter so i suggest the compiler searches first the php modifier instead of the plugin modifier.
after i changed the name to format_date all things work now good.

Additional i think the compiler is more slowly as v2 ? can this be correct?
couse if i compiled first time with force compile it took several seconds to compile, i think the time was at least 1 or 1 1/2 minutes.
After some refresh it loads quick but i have the feeling that v3 is slower than v2.

sorry for my bad english Razz its late
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 -> Smarty 3 All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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