View previous topic :: View next topic |
Author |
Message |
tpanula Smarty Rookie
Joined: 19 May 2003 Posts: 6
|
Posted: Tue Aug 09, 2016 6:28 am Post subject: Composer upgraded to 3.1.30.. tons of problems |
|
|
Our project composer just upgraded our smarty version from 3.1.29 to 3.1.30... now we are getting tons of problems that did not exist before:
Just blank pages, no error messages, nothing.
Fatal error: Uncaught --> Smarty: plugin Smarty_Resource_ is not a valid name format <-- thrown in /SOMEFOLDER/vendor/smarty/smarty/libs/sysplugins/smarty_internal_method_loadplugin.php on line 40
$smarty->display($template, $cacheid, $cachelang); seems to be broken, works if $smarty->display() is used.
anyone else having problems? I think we are downgrading for the time being... |
|
Back to top |
|
kowach Smarty Rookie
Joined: 26 Jan 2011 Posts: 13
|
Posted: Mon Aug 22, 2016 5:30 pm Post subject: |
|
|
I have similar problem with version 3.1.30
First uncached request is about 10 seconds long. I have traced code and found that it locks cache key (I can see LOCK#... key in APC cache for 10 seconds) and then it generates cache template.
I have custom class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore{}.
This should not happening because I'm testing it on dev machine with single request to server.
Code: |
$cid = 'box1';
$smarty->isCached("box.tpl", $cid); // generates lock
echo $smarty->fetch("box.tpl", $cid ); // it should generate cache and remove lock, but it waits 10 sec?!
|
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Sep 15, 2016 4:48 am Post subject: |
|
|
The delay on first uncached template with custom cache resource is now fixed in the master branch |
|
Back to top |
|
ueaole Smarty n00b
Joined: 10 Nov 2017 Posts: 3
|
Posted: Fri Nov 10, 2017 6:10 pm Post subject: |
|
|
I'm seeing the exact same issue as tpanula. I tried to step backwards and debug it but didn't really know what was going on, but here's what I found.
Smarty has a UID 2d185aa406260ef92fd868208b44ef71f7f07115 and it tries to use it as a key in an array in the Smarty_Template_Complied object ->file_dependency array. But when I look at that, it's not in there. That doesn't stop it from trying to load the file and the plugin.. which makes $type null and later when the regex match tries to verify the plugin authenticity, it fails.
Any advice?
Thanks |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Nov 10, 2017 7:02 pm Post subject: |
|
|
Sounds like a compiled template was not saved.
If you have a reproducible short test case, it may help. |
|
Back to top |
|
ueaole Smarty n00b
Joined: 10 Nov 2017 Posts: 3
|
Posted: Fri Nov 10, 2017 10:43 pm Post subject: |
|
|
I don't have a reproducible test case to share, but I did investigate more and find a workaround.
It looks like the problem resides inside {include inline}. The templates are being generated and saved in the filesystem, but I don't believe this should be happening with an inline include.
Whatever is going on after that, $file_dependency ends up not having the ID passed to _renderSubTemplate. The $file_dependency[$uid] lookup fails but continues on with empty variables.
A workaround for this is setting $merge_compiled_includes to true. $file_dependency ends up having the correct ID and the compiled template ends up correct.
Hope this helps find the root cause of this. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Nov 11, 2017 6:53 pm Post subject: |
|
|
Include flag "inline" only means the RESULTS of a template will be inlined, for the purpose of caching. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Nov 12, 2017 12:02 am Post subject: |
|
|
Which Smarty version did you use?
Have you tried to delete the compiled and cached template files once manually after the upgrade?
With composer you can also install "3.1.31" or "~3.1@dev" for the dev-master version of the upcomming 3.1.32 |
|
Back to top |
|
ueaole Smarty n00b
Joined: 10 Nov 2017 Posts: 3
|
Posted: Tue Nov 14, 2017 6:50 pm Post subject: |
|
|
@U.Tews: this has been since 3.1.29. Workaround is working with 3.1.31. I can try and see if the dev version of 3.1.32 is still affected.
And yes, I had previously deleted the cached files when changing versions. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Nov 15, 2017 2:09 am Post subject: |
|
|
How did your {include ....} tag look like.
And please provide the content of the file_dependency array of the compiled template file.
I was not able to reproduce the problem. |
|
Back to top |
|
|