Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2015-12-10 10:08:25
- MrViSiOn
- Member
- Registered: 2014-11-17
- Posts: 26
Update form through database: cache issue
Hi!
I’m trying to update a textpattern form block through txp_form table but changes are not visible while not saving an article form.
In other way, If I save an article form, my changes in a form block (modified in database directly) are showing… If update my form block and not save any article, that changes are not enabled…
This is something about cache… I have install aks_cache, but I didn’t see anything that helps me out
Thank you
Last edited by MrViSiOn (2015-12-10 10:10:06)
Offline
Re: Update form through database: cache issue
I’m not sure if I understood you properly, but if you mean, you see changes when you save an article, but not when you edit a form (in Presentation > Form), then it could be to do with aks_cache.
The reason could be that saving an article triggers a “site contents modified” event, but editing a “form” may not. aks_cache flushes its cache when the site is modified.
If you edited your form directly in the database and not via the admin pane, that too will not trigger a “site contents modified” event.
The solution in both cases is to visit “Extensions > aks_cache” and click “Clear all caches / Reset cache” and your form changes should show.
TXP Builders – finely-crafted code, design and txp
Offline
#3 2015-12-10 15:17:33
- MrViSiOn
- Member
- Registered: 2014-11-17
- Posts: 26
Re: Update form through database: cache issue
EDIT: Thank you for your response!
When I said “through database” I mean with SQL… xD
I’ll review that trigger you said…
It is something textpattern does when I update an article… clear cache or something, I’d like to know what it is… because I have a software for editing blocks in database (SQL). When I update one block, this change will be applied when I “update” a single article.
Any suggestion/idea?
Last edited by MrViSiOn (2015-12-10 15:17:50)
Offline
Re: Update form through database: cache issue
MrViSiOn wrote #297046:
When I said “through database” I mean with SQL… xD
That sounds like it could be the reason, then. It doesn’t matter whether you edit a form or an article (see below)…
It is something textpattern does when I update an article… clear cache or something, I’d like to know what it is… because I have a software for editing blocks in database (SQL). When I update one block, this change will be applied when I “update” a single article.
There’s a pref called lastmod
in the txp_prefs
table that holds a unix timestamp of the last time textpattern was updated. Various functions, like saving an article, update that timestamp routinely when something changes. You can research what happens where with the help of the txp phpxref (thanks to Bert!).
aks_cache holds an own timestamp of its last cache instance and compares that against textpattern’s lastmod timestamp. If they don’t match, it flushes the cache and starts over. If it does match (and other conditions match), then it shows the cached chunk instead.
So: if your own db-update routine also updates the timestamp of lastmod
in the txp_prefs
table, then it would cause the cache to be automatically renewed.
TXP Builders – finely-crafted code, design and txp
Offline