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

Smarty 3 Caching Problem

 
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 -> General
View previous topic :: View next topic  
Author Message
Ancestral
Smarty n00b


Joined: 10 Feb 2022
Posts: 2

PostPosted: Thu Feb 10, 2022 11:22 pm    Post subject: Smarty 3 Caching Problem Reply with quote

Hey Everyone,

We've recently upgraded from Smarty (v3.1.17) to V4.0.0-rc.0 and are having a slight problem.

To support multilingual in the older version of smarty we created a prefix onto the caching templates ie (
en_^9d3372d213f5136f1dc93c973161cfd526f530cd.foo.bar.tpl.php
fr_^9d3372d213f5136f1dc93c973161cfd526f530cd.foo.bar.tpl.php
)

we did this by overriding the isCached function of the parent smarty class with :
Code:
if (!isset($compile_id)) {
         $compile_id = $this->locale["language"].'-'.$this->compile_id;
         $cache_id = $compile_id;
      }



This no longer seems to be working. If you have any suggestions on what might have changed in this process please let us know and if you need any more details please let us know.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Feb 11, 2022 9:49 am    Post subject: Reply with quote

Start using compile_id directly. That's probably the only sane suggestion I could offer.
Back to top
View user's profile Send private message
Ancestral
Smarty n00b


Joined: 10 Feb 2022
Posts: 2

PostPosted: Fri Feb 11, 2022 3:19 pm    Post subject: Reply with quote

AnrDaemon wrote:
Start using compile_id directly. That's probably the only sane suggestion I could offer.


Hey thanks for the reply! Can you provide some more info on that? Every time we try and var_dump compile_id, it returns null.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Feb 15, 2022 5:41 am    Post subject: Reply with quote

You should specify it yourself.
See note in documentation for example use cases https://www.smarty.net/docs/en/variable.compile.id.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 -> General 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