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

new bug in smarty(function, resource extension, nocache tag)

 
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
sm@rty
Smarty Regular


Joined: 01 Oct 2014
Posts: 65

PostPosted: Sun Mar 22, 2015 6:56 pm    Post subject: new bug in smarty(function, resource extension, nocache tag) Reply with quote

hi
i can hardly find this bug.(my project has very page template)

in related with
http://www.smarty.net/forums/viewtopic.php?t=25425&postdays=0&postorder=asc&start=15&sid=1c97dd344ddd38c84f9efdc4f96d111e

Smarty version : new smarty version in githup(today)

please test this example :

%main%
Code:
{nocache}
{require 'test1'}
{/nocache}


test1
Code:
{nocache}
{$a = 'test2'}
{function name=main}
        {"function main loaded.<br>" nocache}
   {require $a}
   {call name='internal' nocache}
{/function}
{call 'main' nocache}
{/nocache}


test2
Code:
{function name=internal}
{"function internal loaded." nocache}
{"no problem here. please refresh again ..." nocache}
{/function}


before run this example, clear all cache and compile file.

in first run :
Code:
function main loaded.
function internal loaded. no problem here. please refresh again ...


in second run :
Fatal error: Uncaught --> Smarty: Unable to find template function 'internal' <-- thrown in ...\smarty\sysplugins\smarty_internal_template.php on line 575

and I've tested this project with update timestamp but display above error.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sun Mar 22, 2015 11:51 pm    Post subject: Reply with quote

Another extreme usage mix of template function definitions and calls
in nocache sections, cached and not cached subtemplates.

It's fixed on Github.

btw:
{require 'test'} with a nocache section when 'test1' is completely nocache does not make sense. It adds just bad performance.
Back to top
View user's profile Send private message
sm@rty
Smarty Regular


Joined: 01 Oct 2014
Posts: 65

PostPosted: Mon Mar 23, 2015 7:57 am    Post subject: Reply with quote

Quote:
It's fixed on Github.

thanks.

Quote:
{require 'test'} with a nocache section when 'test1' is completely nocache does not make sense. It adds just bad performance.

ok.
but this is only a example.
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