Hi guys,

I have a multilingual site (English and Chinese) and the translation for it just started until recently. Everything was working fine with the containers and categories in English but when new containers in Chinese were created to imitate the structure of the English content, problems appeared.

The edit and create node forms did not have the correct list of allowed containers (under Category information -> Hierarchy -> Container). The list only had the new containers in Chinese for any node in any language.

I checked in the module and I could track the problem to the function category_get_containers() in category.inc file. There is a call to category_cache_op which got the wrong containers list.

To solve this problem I just commented that line to avoid the wrong cache information from being loaded:

function category_get_containers($type = NULL) {
  $cache_key = 'c_get_conts'. $type;
  //$containers = category_cache_op('get', 0, $cache_key);

I have very few changes in my content, only by 1 or 2 admins so it should be ok to avoid the cache here. I hope I am not creating another problem by doing this.

This is just a quick fix for my website that should go online soon. Can anyone think of a better solution?

Thanks,

Miguel
SEO and Web Development Beijing

Comments

JirkaRybka’s picture

Well, the cache key should include all information affecting the result. If there's a dependency on language, then we should just add that to the key as well (i.e. concantenate the key with the relevant language code) , so that correct/different results get cached in each case.