Post by damoks » Fri Mar 14, 2008 12:09 am

Hi community,

ive just found that the cache is unable to produce the results in right orders. This is because of the caching of items are not ordering the results by using the sort_order column settings.

for example

in the library/language/language.php

Code: Select all

$results = $this->database->cache('language', "select * from language");
just produces the cache without using the sort_order rule.

replace the above sentence with the following:

Code: Select all

$results = $this->database->cache('language', "select * from language order by sort_order");
By replacing the line, you'll get the language sorted on everywhere, for example you can edit the product description by using the 0. sort ordered language (thats hungarian for me). If your shopping cart have other languages than english, this is a very useful modding, but doesnt causes any problem if you are use only 1 language.

You can done this cache modding on other modules also.

regards,
damoks


ps: please note that you have to delete the appropriate cache file that contains the old cache mirror after you made the changes. for example, delete the file cache.language.*.
Last edited by damoks on Fri Mar 14, 2008 12:25 am, edited 1 time in total.

Newbie

Posts

Joined
Fri Mar 14, 2008 12:00 am

Post by damoks » Thu Mar 27, 2008 4:05 pm

I have found an another cache bug while using it on multilingual shops.

Some of the objects are produces the cache by patching its name with a language_id. Like this: cache.weight_class-2.1206608816
The -2 stands for the extra language id. Thats cool, but if you modify the cached table (like updating any value in the admin place) it cant delete the extra patched cache, but deletes only the standard named one.

To handle this problem, you have to place an additional asterix to the file name, to delete every language specific cache for the modified tables.

in library/cache/cache.php, at function delete()

foreach (glob(DIR_CACHE . 'cache.' . $key . '.*') as $file) {

This may looks ok, but unfortunately most of the objects has forgot to implement the language id to the $key while calling a cache deleting. So this one is generates the filename like this: cache.weight_class.* (but this file is not exists, because we use the engine in multilingual mode)

For the good result, use the above:

foreach (glob(DIR_CACHE . 'cache.' . $key . '*.*') as $file) {

It patches the filename, so it will look like this. cache.weight_class*.*
With this patch you can eliminate every language specific cache. But why not? If you modify anything, the shop have to recache the new values. It doesnt matter that you modified only the english or any other language based setting. The information must be refreshed!

thanks
Last edited by damoks on Thu Mar 27, 2008 4:08 pm, edited 1 time in total.

Newbie

Posts

Joined
Fri Mar 14, 2008 12:00 am

Post by Nonconforme » Sat Apr 05, 2008 8:46 am

thanks a lot for your work

Newbie

Posts

Joined
Sat Apr 05, 2008 7:02 am

Post by fancymask » Wed May 14, 2008 12:37 am

thank you! it works!

Newbie

Posts

Joined
Fri Apr 25, 2008 4:52 pm
Who is online

Users browsing this forum: No registered users and 4 guests