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

Bug/Error in smarty_internal_compile_include

 
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
tiberian
Smarty Rookie


Joined: 19 Aug 2003
Posts: 5
Location: Germany, Wadersloh

PostPosted: Wed Nov 11, 2009 8:45 am    Post subject: Bug/Error in smarty_internal_compile_include Reply with quote

Hi there,

i just wanted to check out the new Version in a larger project. After including all new Files from beta1 I get this error Message:

Code:
Fatal error: Call to undefined method Smarty_Internal_Resource_File::getTemplateTimestampTypeName() in …/lib/Smarty3/sysplugins/smarty_internal_compile_include.php on line 54


I tried to figure out what's going wrong, but I didn't get the idea.

Is it a bug? Or am I'm something wrong?
Thanks!
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: Wed Nov 11, 2009 5:07 pm    Post subject: Reply with quote

Have you used the latest version from the SVN? it does include some bugfixes
Back to top
View user's profile Send private message
tiberian
Smarty Rookie


Joined: 19 Aug 2003
Posts: 5
Location: Germany, Wadersloh

PostPosted: Thu Nov 12, 2009 10:31 am    Post subject: Reply with quote

Yes, I used latest SVN co (Rev. 3329)
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


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

PostPosted: Thu Nov 12, 2009 2:22 pm    Post subject: Reply with quote

Did you clear out compiled templates after an SVN update?
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: Thu Nov 12, 2009 4:19 pm    Post subject: Reply with quote

There is another possibility.

Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings in parameters. Smarty3 is more restrictive. You can still pass strings without quotes so long as they contain no special characters. (anything outside of A-Za-z0-9_)

So filename string should be specified with quotes like

{include file='path/foo.tpl'} normally I would expect that you get an error if this is not the case, but please check.

I that is okay please place a var_dump in file smarty_internal_compile_include.php that around line 53 it looks like this:

$tpl->parseResourceName($_file_to_check[0], $resource_type, $resource_name, $resource_handler);
var_dump($_file_to_check[0], $resource_type, $resource_name);

It looks like that for some reasion the file dependency information got destructed.
Back to top
View user's profile Send private message
moob
Smarty n00b


Joined: 02 Feb 2012
Posts: 1

PostPosted: Thu Feb 02, 2012 9:24 am    Post subject: Reply with quote

Pay atention to the paths in the include function. Incorrect path in include returns this error.
Depends on the absolute path of the file from where you are calling the template that contains include.
Code:
{include file='blackmenu.tpl'}

or
Code:
{include file='../../smarty/templates/blackmenu.tpl'}
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
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