Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
compileAllTemplates causes "Call to undefined function&

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
GregMartyn
Smarty n00b


Joined: 07 Jun 2013
Posts: 2

PostPosted: Fri Jun 07, 2013 1:38 pm    Post subject: compileAllTemplates causes "Call to undefined function& Reply with quote

I'm having trouble getting compileAllTemplates to work. I consistently get this error that I don't get when I $smarty->fetch($template) the affected template manually.
PHP Fatal error: Call to undefined function content_51b100241d1346_46516748()

(the numbers following content_ change each time I call compileAllTemplates)

This error is perfectly reproducible. If I clear my compile dir and run compileAllTemplates, I get the error. If I clear the compile dir and run $smarty->fetch($template), it compiles correctly and I don't get the error.

It seems to have something to do with an {include} inside an {include} inside a {block}. The files included at just one level of {include} inside the {block} work correctly, but when there is a 2nd level of {include}, I hit the error above. This same file is included in the footer on every page of the site, so it may be that the compilation of one template in compileAllTemplates is interfering with the next. I do see that one of the compiled templates with that footer includes the function, but none of the dozens of other pages that include that footer do. I also noticed that that file named by the 2nd level {include} is not listed in the compiled template's file_dependency list when compileAllTemplates is run, but it is there when I compile the template directly.
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Sun Jun 09, 2013 7:43 pm    Post subject: Reply with quote

This is a shortcoming of compileAllTemplates and template inheritance.

Currently template inheritance is resolved during compile time. compileAllTemplates reads the directory of the template folder and just compiles all files. It's likely that templates inheritance will not be resolved correctly.

There is no fix for 3.1 but because of major internal changes it will no longer be a problem in the next major release 3.2 which will be availaable later this year.
Back to top
View user's profile Send private message
GregMartyn
Smarty n00b


Joined: 07 Jun 2013
Posts: 2

PostPosted: Wed Jun 12, 2013 2:39 pm    Post subject: Reply with quote

Ok, thanks. Good to know.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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