Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev-master has problems with compiled templates #20

Closed
m038 opened this issue Mar 19, 2015 · 8 comments
Closed

Dev-master has problems with compiled templates #20

m038 opened this issue Mar 19, 2015 · 8 comments

Comments

@m038
Copy link

m038 commented Mar 19, 2015

After upgrading to commit #e9b1f296cb7217b37ac55ed7b2333342a304f295, recommend to fix my previous issue, we are experiencing problems with compiled templates. As soon as we don't use caching/compiled templates, it's all working fine.

SmartyException: Invalid compiled template for '/var/www/newscoop/application/views/scripts/legacy_index.tpl'
in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php line 342
at Smarty_Internal_Template->getRenderedTemplateCode() in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_template_cached.php line 212
at Smarty_Template_Cached->render(object(Smarty_Internal_Template)) in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php line 268
at Smarty_Internal_Template->render(true, false, true) in /var/www/newscoop/vendor/smarty/smarty/libs/Smarty.class.php line 726
at Smarty->fetch('/var/www/newscoop/application/views/scripts/legacy_index.tpl', null, null, null, true) in /var/www/newscoop/vendor/smarty/smarty/libs/Smarty.class.php line 740
SmartyException: Invalid compiled template for '_tpl/header.tpl'
in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php line 342
at Smarty_Internal_Template->getRenderedTemplateCode() in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_template_cached.php line 212
at Smarty_Template_Cached->render(object(Smarty_Internal_Template)) in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php line 268
at Smarty_Internal_Template->render(true, false, true) in /var/www/newscoop/vendor/smarty/smarty/libs/Smarty.class.php line 726
at Smarty->fetch('_tpl/header.tpl', null, null, null, true) in /var/www/newscoop/vendor/smarty/smarty/libs/Smarty.class.php line 740
at Smarty->display('_tpl/header.tpl') in /var/www/newscoop/include/smarty/campsite_plugins/function.render.php line 84
at smarty_function_render(array('file' => '_tpl/header.tpl'), object(Smarty_Internal_Template)) in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_cacheresource_custom.php(144) : eval()'d code line 1574
at content_550aa9402cb130_71307622(object(Smarty_Internal_Template)) in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php line 351
at Smarty_Internal_Template->getRenderedTemplateCode() in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_template_cached.php line 212
at Smarty_Template_Cached->render(object(Smarty_Internal_Template)) in /var/www/newscoop/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php line 268
at Smarty_Internal_Template->render(true, false, false) in /var/www/newscoop/vendor/smarty/smarty/libs/Smarty.class.php line 726
@ahilles107
Copy link

👍 have this same issue - reverting smarty to 3.1.21 fixes it. Looks like problem is with new getRenderedTemplateCode function.

@uwetews
Copy link
Contributor

uwetews commented Mar 20, 2015

Did you clear the cache after the upgrade? Can I find somewhere the code of the custom cache resource and the render plugin?

@ahilles107
Copy link

@uwetews
Copy link
Contributor

uwetews commented Mar 23, 2015

Do you use in your application template functions ({function ...}...{/function} and do you call these in {nocache}{/nocache} sections?
Here is a major difference between 3.1.21 and the upcoming 3.1.22 (master).
In 3.1.21 the template function code was evaluated. In 3.1.22 Smarty will update the cache by adding template function code to the cache file.
I such case Smarty will call Smarty_CacheResource_Newscoop::fetch() a second time to read the cache source, update it and write it back with Smarty_CacheResource_Newscoop::save().
It could be that the TemplateCacheHandler_DB does not handle this correctly and does corrupt the cache content.
The corresponding Smarty code can be found in smarty_internal_function_call_handler.php.
This functionality has been tested with our custom resource cacheresource.mysql.php.

Currently I can't see any other cause for the problem.

@ahilles107
Copy link

Hey @uwetews , thanks for checking but for us 3.1.22 works ok, problem is with latest master. This info change something?

@uwetews
Copy link
Contributor

uwetews commented Mar 23, 2015

I was not precise: 3.1.22 is not yet released = master.

@ahilles107
Copy link

Yeah, sorry it's late. 3.1.21 works ok for us. We will check Smarty_CacheResource_Newscoop. Thanks!

@uwetews
Copy link
Contributor

uwetews commented May 4, 2015

I think this can be closed

@uwetews uwetews closed this as completed May 4, 2015
think-mcunanan pushed a commit to think-mcunanan/smarty that referenced this issue Mar 22, 2023
…les-under-tmp-folder-to-gitignore

Merge ticket-#5122-add-files-under-tmp-folder-to-gitignore into release-2.0.3 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants