I had Google Checkout installed, then I disabled and uninstalled it. When I try to install it again:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'in_google_checkout' for key 'PRIMARY': INSERT INTO {uc_order_statuses} (order_status_id, title, state, weight, locked) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4), (:db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array
(
    [:db_insert_placeholder_0] => in_google_checkout
    [:db_insert_placeholder_1] => In Google Checkout
    [:db_insert_placeholder_2] => in_checkout
    [:db_insert_placeholder_3] => -7
    [:db_insert_placeholder_4] => 1
    [:db_insert_placeholder_5] => chargeable
    [:db_insert_placeholder_6] => Chargeable
    [:db_insert_placeholder_7] => post_checkout
    [:db_insert_placeholder_8] => 2
    [:db_insert_placeholder_9] => 1
)
 in uc_google_checkout_install() (line 167 of /xxx/sites/all/modules/ubercart/payment/uc_google_checkout/uc_google_checkout.install).

This seems to be because uc_google_checkout does not remove the 'in_google_checkout' status from the DB in hook_uninstall(), so when you run hook_install() again if fails when it tries to do a db_insert() of the 'in_google_checkout' status.

I know removing order statuses from the DB is problematic, so maybe it was left in the DB intentionally - if so the hook_install() should check for it and db_update() instead of db_insert().

Comments

Island Usurper’s picture

Status: Active » Fixed

Hooray for db_merge(). If those statuses are still there, the old titles and weights won't be overwritten.

tr’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.