I was getting duplicate entry (primary key) errors in the uc_custom_price table. I changed uc_custom_price.module

Basically I moved the 'insert' query into the 'insert' case.

Patch below.

Comments

griz’s picture

StatusFileSize
new1.3 KB

One patch.

griz’s picture

ok, i thought this worked.It doesn't. Working on it.

griz’s picture

Ok, now it works.

griz’s picture

StatusFileSize
new1.41 KB

#$?&!

hacmx’s picture

testing & Working, thx man! :)

tr’s picture

@griz: I think the patch improves the code, but I'm curious as to what you were doing that resulted in a duplicate key error? I can't reproduce that error. Are you using a database other than MySQL by any chance?

griz’s picture

Nothing special as far as I am aware. I'm using MySQL on ubuntu 10.04, PHP 5.3.
I think it might be a 5.3 thing, but that's just a hunch.

hacmx, what about you?

hacmx’s picture

I'm on mysql 4.1.22 / php 5.2.10 / Linux

The error message appears after editing a node with this module without changing any of the content.

chinita7’s picture

I applied #4 and my error is gone. I'm also using PHP 5.3. Thnaks.

alan_hugo’s picture

Thanks Griz, this helped me a great!! :)

griz’s picture

Status: Needs review » Reviewed & tested by the community

:)
RTBC, isn't it?