When saving a product the product kit updates all product kits that contain the product.
The bug is in product_kit.module:247
The statement $result = db_query("SELECT nid FROM {uc_product_kits} WHERE product_id = %d", $node->nid);
Is selecting the node id of every product kit that contains that product, but it is not taking into account the version id and that there can be multiple revisions of the product kit in that table.
I added "DISTINCT" to the select and now instead of updating each product kit hundreds of times it runs only once.
$result = db_query("SELECT DISTINCT nid FROM {uc_product_kits} WHERE product_id = %d", $node->nid);
I noticed that it was taking a long time to update a product and i was getting info messages that "The Product Kit has been updated." many times. It was about 30 messages, then 80 and then 300.
-Ed
| Comment | File | Size | Author |
|---|---|---|---|
| recursive-update.diff | 726 bytes | edhaber |
Comments
Comment #1
Island Usurper commentedThank you kindly. I always forget about revisions.