stock report includes all revisions

Project:Ubercart Contributions
Component:Code
Category:
Priority:normal
Assigned:Unassigned
Status:active
Description
Project: 
Ubercart

Hi,

The stock report currently pulls in all revisions of a product, resulting in many duplicates when revisions is turned on and being used. I think the problem is this SQL statement from line 235 of uc_stock:

$sql = "SELECT s.nid,`sku`,`title`,`stock`,`threshold` FROM {uc_product_stock} as s LEFT JOIN {node_revisions} as n ON s.nid = n.nid WHERE active = 1";

Best,
Chad

Shawn Conn's picture
Offline
Administrator
Joined: 08/07/2007
Juice: 916
Re: stock report includes all revisions

Right, I don't know how node_revision got in there...must of been a tiring day at work that day. Anyway, the fix is made and will be committed later in the day.

-Shawn Conn: If the Name Don't Rhyme It Ain't Mine

Poieo's picture
Offline
Joined: 08/06/2008
Juice: 24
Still a Problem
Assigned to:Shawn Conn» Poieo

I know this post is very old, but I'm using 5.x - 1.7 and the problem seems to still exist. I haven't actually created any revisions, but if I change the sku of a product, both the original sku and the new sku appear in the stock report. Both link to the current product, but there are two entries and the stock for the old sku is stuck at whatever it was when I changed the sku.

Any thoughts?