View Issue Details

IDProjectCategoryView StatusLast Update
0005666OXID eShop (all versions)4.01. Database handlingpublic2014-04-11 16:38
Reporter[email protected] 
PriorityhighSeveritymajorReproducibilitysometimes
Status resolvedResolutionno change required 
Product Version4.8.3 / 5.1.3 
Target Version4.8.5 / 5.1.5Fixed in Version 
Summary0005666: Count of articles is wrong in article listing
DescriptionThe article count is not always right in the article listing. I fixed this for my setup by adding GROUP BY $sArticleTable.oxid to the select statement in oxarticlelist.php in the function _getCategorySelect()
TagsCategory
ThemeBoth
BrowserAll
PHP Versionany
MySQL Versionany

Relationships

related to 0005736 resolvedaurimas.gladutis oxobject2category index OXMAINIDX should be unique 

Activities

jurate.baseviciene

2014-02-21 08:29

reporter   ~0009565

Reminder sent to: [email protected]

Hi,

Unfortunately we can't reproduce this bug. Could you please give us more details how to reproduce this case?

Best regards

[email protected]

2014-02-21 09:29

reporter   ~0009570

Hi,

the problem occurred when we wanted to display 108 articles in the category listing (the complete category has about 400 articles). We noticed the wrong number because we have a three column design and in the last row there was always missing one article. So the design was screwed. When I looked at the count of articles which was displayed it was 83, not 108.

Hope I could help you. I dont know, this maybe a problem which only occurs after some time (the shop is online since 2012).

Best regards
Max

leofonic

2014-02-21 11:19

reporter   ~0009575

Last edited: 2014-02-21 11:25

View 2 revisions

Maybe this is caused by bugs in 3rd party importers, which assign articles twice to category, i have seen this happen. Execute the following SQL in Shop with demodata:

INSERT INTO `oxobject2category` (`OXID`, `OXOBJECTID`, `OXCATNID`, `OXPOS`, `OXTIME`, `OXTIMESTAMP`) VALUES
('b964ba2b2fac8f9fd44b7ce743273539', 'b56369b1fc9d7b97f9c5fc343b349ece', '0f4fb00809cec9aa0910aa9c8fe36751', 0, 0, '2014-02-21 11:10:56');

Now look at category kites in frontend, one article is missing on first page.

Maybe Solution would be to set Index OXMAINIDX unique, so this can't happen.

[email protected]

2014-02-21 11:39

reporter   ~0009576

This was my first thought too, since the products are imported, but I already checked this when I debugged, the articles "are lost" in oxList::selectString() in the following lines:

if ($oListObject->getId()) {
  $this->_aArray[$oListObject->getId()] = $oListObject;
}

I checked some IDs which are double in the oListObject but in the database they are unique, I have no clue where this came from. I will later investigate further maybe I'll find something.

leofonic

2014-02-21 12:28

reporter   ~0009581

To test you can try to change oxobject2category index OXMAINIDX to unique, if you get an error you have duplicates.

Linas Kukulskis

2014-04-11 16:38

reporter   ~0009831

yes the reason is the duplicated assignment of article to category, grouping will solve it but it can bad for performance. it is better to keep data clean (without duplication) in database. so solution is to fix importer.