Just trying this module:
- installed it & activated
- ran cron
- navigated to /admin/store/settings/uc_views_upsell then pressed Rebuild now
A series of messages similar those above is shown:

user warning: Duplicate entry '4-5' for key 'PRIMARY' query: INSERT INTO uc_product_pairs (nid, pair_nid, orders) VALUES (4, 5, 1) in ...\sites\all\modules\uc_views_upsell\uc_views_upsell.module on line 49

Comments

mandreato’s picture

The messages are shown every time cron runs

longwave’s picture

Are you using product attributes? I didn't test with attributes installed, perhaps there is an incompatibility here that needs fixing..

mandreato’s picture

Yes I was, but after disabling and uninstalling the attribute module the errors are still present.

longwave’s picture

That will be because there are previously ordered products with attributes that aren't deleted when you uninstall uc_attribute, and these will have duplicate nids. I need to do some tests with attributes enabled to figure out the best fix for this.

mandreato’s picture

Thank you longwave.

Kalorlo’s picture

Subscribing - I use attributes and am interested in using this module.

Whole Human’s picture

Subscribing as well. I want to use this, but I will have products with attributes...

oivind’s picture

Subscribing.

misc’s picture

This could be related to: http://drupal.org/node/1151824 - I got similar warnings like the above, and the fix made them go away.

nimicohgr’s picture

subscribing as welll. FYI the curly brace fix in dev branch does not resolve issue. I also use attributes. I am willing to allow access to my site, if/when Longwave has time to look.

Piyush’s picture

Came across this same issue after re-hosting a working site (with PHP 5.2 and no warning messages) on a new server with PHP 5.3. Finally found a working fix/answer at http://drupal.org/node/638702#comment-2615634 i.e. prefix the INSERT db_query with @. And can confirm that this does indeed suppress the warning messages in the logs and on screen on rebuilding the pair data.

There is more discussion on this problem with regards to the php mysqli_affected_rows function at http://drupal.org/node/805858.

Hope this helps.

loparr’s picture

@Piyush I re-hosted my site from server with php 5.2 to another server with php 5.3 but that patch did not solve errors. I think changes has to be made inside uc_views_upsell.module

This patch which is included in dev version did not solve it either http://drupal.org/node/1151824
Any ideas?