View Issue Details

IDProjectCategoryView StatusLast Update
0003344OXID ERP InterfaceOXID ERP Interface - subpublic2014-03-18 12:11
Reporterfaltmeyer Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.10.0_45565 
Fixed in Version2.11.0_52702 
Summary0003344: Caching Numbers of contained products in category
Descriptionin LocalCatCahe.txt the numbers of contained products of each category will be cached. If assigment of product to category will be done in admin area, the cache file will be updated. But if I change assigment of product to category via ERP Soap Service, the cahe file will be untouched.
So umbers of products of each category in frontend will show the wrong value.
TagsNo tags attached.

Relationships

related to 0005697 acknowledged ERP call timeouts while reassigning articles to categories 

Activities

ray

2012-06-25 10:41

reporter   ~0006970

which as well leads to another problem: the pagination does not work correct and offers only a few pages, not all - based on the wrong, old value of contained products

leofonic

2012-06-25 17:52

reporter   ~0006978

Two suggestions for counting category articles:

1. in oxutilscount::setCatArticleCount there is sql-code which is the same as in oxarticlelist::_getCategoryCountSelect. If _getCategoryCountSelect would be public, oxutilscount could use it like

        $oArtList = oxnew("oxarticlelist");
        $sQ = $oArtList->getCategoryCountSelect( $sCatId, null );
        $aCache[$sCatId][$sActIdent] = $oDb->getOne( $sQ );

This would give the possibility to modify article loading in a category by modifying _getCategoryCountSelect and _getCategorySelect.

2. in oxarticlelist::loadCategoryArticles cached number is used in case no filter is active (this does not test if filter is set for current category). Suggestion is: always really count articles here with _getCategoryCountSelect, and if no filter is active for current category, compare with cached article count and update cache on mismatch. This is just one sql and very little overhead, and would assure that article count for active category is up-to-date.

stefan2

2012-11-20 16:01

reporter   ~0007918

Hi
[QUOTE]
always really count articles here [...] compare with cached article count
[/QUOTE]

This way makes the cache useless... but and you can reduce the appeared overhead (compare, refresh cache) by removing the caching totally from this function. This is not a solution. The only solution is to keep the cache untouched until the number of products is changed. Any process that change the number of products should delete the related cachefile(s).

leofonic

2012-11-20 17:07

reporter   ~0007920

Last edited: 2012-11-20 17:07

"This way makes the cache useless... "

No, this just disables cache for currently active category. Caching is still active for all other categories in oxcategory::getNrOfArticles. You will not notice any difference in speed of page loading by disabling cache of category count only for active category, just try it.

Caching is not needed here, and the number of articles in current category is important because it controls the number of pages displayed. There are lots of processes that change the number of articles, chance is high that you miss one and get the wrong number. For example, if you change stock to zero in admin and a product goes offline, cache is not updated.

arturas.sevcenko

2012-11-21 08:51

reporter   ~0007921

Last edited: 2012-11-21 08:52

now article cache is updated in erp