Going along just fine for months, and all of a sudden my client is complaining of getting this error message when editing stories (not products):

user warning: Duplicate entry '2835' for key 'PRIMARY' query: INSERT INTO uc_restrict_shipping VALUES (2835, '0', '0', 0) in /home/naturalwine/naturalwine.com/sites/all/modules/uc_restrict_shipping/uc_restrict_shipping.module on line 657.
user warning: Duplicate entry '2835' for key 'PRIMARY' query: INSERT INTO uc_right_customer VALUES (2835, 0) in /home/naturalwine/naturalwine.com/sites/all/modules/uc_right_customer/uc_right_customer.module on line 50.

Sure enough nid 2835 has rows in both the uc_restrict_shipping and uc_right_customer tables. So there are at least two things happening: 1) non-UC nodes are being assigned UC attributes and 2) when editing (rather than creating) a node these rows are being INSERTed rather than UPDATEd.

If it was either uc_restrict_shipping or uc_right_customer, I'd put this message in one of those queues. Because it's both there's got to be something going on above their pay grades.

Comments

longwave’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I don't see why you think this is something that can be fixed in Ubercart, as the errors are in contributed modules. It's more likely those modules are not using the Ubercart API correctly.

tr’s picture

Project: Ubercart » Ubercart Restricted Shipping
Version: 6.x-2.7 » 6.x-1.0
Category: support » bug
Status: Postponed (maintainer needs more info) » Active

This is caused by failure to check node type in hook_nodeapi(). Moving to the correct queue, as this is not an Ubercart issue.

smscotten’s picture

@longwave at least allow me to defend myself; I don't think I'm a complete moron. Yes, contributed modules, but two different contributed modules. Maybe it's a coincidence that both modules have the same error that presented itself at the same time, but that's not the sort of first conclusion I jump to.

@TR thank you. I'll take a look at both modules' use of hook_nodeapi() and see what I can see.