Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
3rd party integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2011 at 19:15 UTC
Updated:
1 Aug 2011 at 21:01 UTC
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
Comment #1
Island Usurper commentedHooray for db_merge(). If those statuses are still there, the old titles and weights won't be overwritten.
Comment #2
tr commentedCan you make the same fix for #551710: Paypal order status left over after uc_paypal uninstall ?