View previous topic :: View next topic |
Author |
Message |
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Apr 30, 2010 2:13 am Post subject: Smarty 3 RC1 Released |
|
|
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 |
|
m-g Smarty Rookie
Joined: 12 Jan 2010 Posts: 6 Location: Germany
|
Posted: Fri Apr 30, 2010 5:34 am Post subject: detailed version information |
|
|
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 |
|
moneysack Smarty Rookie
Joined: 25 Mar 2010 Posts: 10 Location: Hamburg
|
Posted: Fri Apr 30, 2010 9:04 am Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Apr 30, 2010 1:13 pm Post subject: |
|
|
This has been updated in the SVN.
Danke |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Apr 30, 2010 9:21 pm Post subject: |
|
|
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 |
|
moneysack Smarty Rookie
Joined: 25 Mar 2010 Posts: 10 Location: Hamburg
|
Posted: Fri May 14, 2010 1:24 pm Post subject: |
|
|
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 |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri May 14, 2010 1:47 pm Post subject: |
|
|
Thanks for bringing it up. The fix is in the SVN now. |
|
Back to top |
|
andrethehook Smarty n00b
Joined: 14 May 2010 Posts: 1
|
Posted: Fri May 14, 2010 9:40 pm Post subject: setC |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri May 14, 2010 9:57 pm Post subject: |
|
|
Nothing has been changed there. It does work in my place. |
|
Back to top |
|
SIR JEDI Smarty n00b
Joined: 27 May 2010 Posts: 1
|
Posted: Thu May 27, 2010 12:59 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu May 27, 2010 4:01 pm Post subject: |
|
|
This was a bug in chained objects using variable properties.
The fix is in the SVN now |
|
Back to top |
|
grmbl Smarty Rookie
Joined: 12 Jan 2010 Posts: 7
|
Posted: Tue Jun 01, 2010 10:54 am Post subject: |
|
|
There seems to be a problem with functions in parent templates:
wrapper.html:
Code: | {function name=info_guides}...some code...{/function}{block name='content'} {/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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jun 01, 2010 5:12 pm Post subject: |
|
|
THe bug when using template functions and templatze inheritance is fixed in the SVN now. |
|
Back to top |
|
grmbl Smarty Rookie
Joined: 12 Jan 2010 Posts: 7
|
Posted: Tue Jun 01, 2010 7:42 pm Post subject: |
|
|
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 |
|
prdatur Smarty n00b
Joined: 12 Jun 2010 Posts: 2
|
Posted: Sat Jun 12, 2010 9:54 pm Post subject: modifier date_format |
|
|
Hello,
I upgraded our beta project now from v2 to v3 rc1.
After i did this, i needed to change a lot of things
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 its late |
|
Back to top |
|
|