VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: doorknob on July 03, 2008, 20:34:06 PM

Title: Cache bug
Post by: doorknob on July 03, 2008, 20:34:06 PM
Running with Joomla caching switched on causes a number of problems. The most prominent is the duplication of products in the browse list. This affects all browse list styles except 'Flat Product List'. The cause of this problem is the use of the template class function fetch_cache(). This function caches the template file and when the same file is called many times on the same page, as is the case on browse pages, the cached value is recalled and every entry appears the same.

The cause of this is that the function vmTemplate->getCacheId() expects that the variables $modulename, $pagename, $product_id, $category_id, $manufacturer_id, $auth, $limitstart, $limit have been set up prior to the function being called but they have not. That means that every product get the same cache ID and so the cached version is reused for a different product.

A short-term workaround can be implemented in browse_layouttable.tpl.php and browse_notables.tpl.php by changing the call to fetch_cache() to fetch().

Note: 'Flat Product List' is not affected by this problem because it does not use a template file and therefore cannot be cached.

Tested on J1.5.3 with VM nightly update 2008/7/2.

Regards
Phil
Title: Re: Cache bug
Post by: aravot on July 23, 2008, 21:44:37 PM
This has been fixed in latest nightly build 1481
Title: Re: Cache bug
Post by: guimplenchik on October 16, 2008, 01:01:15 AM
Strange thing..I thought this bug is fixed (#2227 https://dev.virtuemart.net/cb/issue/2227) , but I use J!1.0.15 + VM 1.1.2 with core cache enabled and this problem still exists..

Any suggestions?

Thanks
Title: Re: Cache bug
Post by: jenkinhill on October 16, 2008, 11:26:47 AM
Maybe fixed for J!1.5.x but not for J!1.0.x - I no longer have old versions of Joomla around to check this.
Title: Re: Cache bug
Post by: jordank87 on November 13, 2008, 16:45:07 PM
I tried this on joomla 1.5.7 and vm 1.1.2 and still have the "bug" meaning products are duplicated in the categories???

Title: Cache bug VM theme displays duplicate products
Post by: Yereverluvinunclebert on December 02, 2008, 14:10:24 PM
I am using 1.1.2 on my site with a theme and I am experiencing the same issue. Do you know when is this going to be fixed?

I have implemented the workaround so my site is OK for the moment but unfortunately I have a client who is not impressed by the speed of Joomla 1.5 and so I have to do a load of tuning to get the site working as quickly as it can.

Cacheing working as it should, on the products as displayed by a VM theme, is a necessity for me.

Yereverluvinunclebert
Title: Re: Cache bug
Post by: archerwebsolutions on March 26, 2009, 00:53:29 AM
Quote from: doorknob on July 03, 2008, 20:34:06 PM
Running with Joomla caching switched on causes a number of problems. The most prominent is the duplication of products in the browse list. This affects all browse list styles except 'Flat Product List'. The cause of this problem is the use of the template class function fetch_cache(). This function caches the template file and when the same file is called many times on the same page, as is the case on browse pages, the cached value is recalled and every entry appears the same.

The cause of this is that the function vmTemplate->getCacheId() expects that the variables $modulename, $pagename, $product_id, $category_id, $manufacturer_id, $auth, $limitstart, $limit have been set up prior to the function being called but they have not. That means that every product get the same cache ID and so the cached version is reused for a different product.

A short-term workaround can be implemented in browse_layouttable.tpl.php and browse_notables.tpl.php by changing the call to fetch_cache() to fetch().

Note: 'Flat Product List' is not affected by this problem because it does not use a template file and therefore cannot be cached.

Tested on J1.5.3 with VM nightly update 2008/7/2.

Regards
Phil

These changes appear to be in my code, and yet when the cache is on, we still have a problem with the first items in the product list being duplicated. Any ideas?
Title: Re: Cache bug
Post by: aravot on March 27, 2009, 00:31:08 AM
I can not duplicate this on my test site, do you have a URL and your Joomla+VirtueMart settings.
Title: Re: Cache bug
Post by: dchaplinsky on July 04, 2009, 13:29:37 PM
Hi.

I've got the same issue with Joomla 1.5.11 & Virtuemart 1.1.3 stable on my website http://ink.su (now caching disabled, of course).

The reason was the third-party template for virtue, which I'm using. After switching to default template issue gone. I will make additional investigations and come with solution for ppl who using custom templates.
Title: Re: Cache bug
Post by: dchaplinsky on July 04, 2009, 13:34:10 PM
Ah, you've just disabled caching for subitems in default template :)
grrr
Title: Re: Cache bug
Post by: Yereverluvinunclebert on July 09, 2009, 18:41:40 PM
VM shows multiple versions of the same product
==============================================

The cause of this is that the function vmTemplate->getCacheId() expects that
the variables $modulename, $pagename, $product_id, $category_id,
$manufacturer_id, $auth, $limitstart, $limit have been set up prior to the
function being called but they have not. That means that every product get
the same cache ID and so the cached version is reused for a different product.

A short-term workaround can be implemented in browse_layouttable.tpl.php
and browse_notables.tpl.php by changing the call to fetch_cache() to fetch().
Title: Re: Cache bug
Post by: Luciffere on July 14, 2009, 13:40:48 PM
This happened to me... See my post http://forum.virtuemart.net/index.php?topic=57971.0