I've been doing a little work with the Texy! filter, as the Czech quotes were annoying me. I'd made the necessary alterations to include a "locale" (as Texy!'s api calls it) setting in texy_admin_settings(), but when these settings are actually submitted I want to have it clear out the cache_filter table (ie 'delete from cache_filter').

Is there some kind of hook, meta-hook, or hook trigger I can use for this? I'm looking for something I can define in the module itself.

The problem is that when I change languages, I need to clear our cache_filter before the changes actually take effect. Otherwise, you make the change and test it out but nothing actually changes!

Comments

auroqn’s picture

Actually i don't wanted to cache category filter on node page list ( admin/content/node ).

The caching system is usefull, but when you have multilingual site (like me) and have taxonomy terms multilingual also, then the category filter displays whole list of terms. It should display the terms from active language, but it doesn't ( it worked as intended when i cleared the cache tables manually, but after switching the language, the cache data was recreated and the list was full of therms again - some names where the same in different languages so i didn't knew which one schould i select...).

I decided to put very simple hack into cache.inc


function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) {
$tmp_cid = substr(strstr($cid,":"),1)  ; //added
 if(  !($tmp_cid == "pl"  ||   $tmp_cid == "it" || $tmp_cid == "en" ) ) { //added - this represents my stripped out cache menu ids

  db_lock_table($table);
  db_query("UPDATE {". $table. "} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid);
  if (!db_affected_rows()) {
    @db_query("INSERT INTO {". $table. "} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $cid, $data, time(), $expire, $headers);
  }
  db_unlock_tables();
  }//added 
}

it prevents inserting cache data to 'cache_menu' table (it is restricted to only 3 particular items - pl,en,it which are representing my language menu ). so that my lang switch, doesn't cache anymore ;) and the category filter seems to work just fine. The performance performance hit is almost none - these are only three menu items .

So anybody having trouble witch filtering multilingual categories / terms, schould try this :)