Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.1.3
-
Component/s: None
-
Labels:None
Description
Array ( \[error\] => Array ( \[0\] => The import completed but the following errors ocurred: \[1\] => importClients: SQLSTATE\[23000\]: Integrity constraint violation: 1062 Duplicate entry '35' for key 'PRIMARY' on line 196 \[2\] => importContacts: There is already an active transaction on line 231 \[3\] => importTaxes: There is already an active transaction on line 231 \[4\] => importCurrencies: SQLSTATE\[HY093\]: Invalid parameter number: number of bound variables does not match number of tokens on line 196 \[5\] => importInvoices: There is already an active transaction on line 231 \[6\] => importTransactions: There is already an active transaction on line 231 \[7\] => importPackages: SQLSTATE\[HY093\]: Invalid parameter number: number of bound variables does not match number of tokens on line 196 \[8\] => importServices: There is already an active transaction on line 231 \[9\] => importSupportDepartments: There is already an active transaction on line 231 \[10\] => importSupportTickets: There is already an active transaction on line 231 \[11\] => importAffiliates: There is already an active transaction on line 231 \[12\] => importMisc: There is already an active transaction on line 231 ) )
To resolve:
In plugins/import_manager/components/migrators/whmcs/whmcs_migrator.php change line 340 from
// Set account for autodebit if ($account_id) { $vars = [ 'client_id' => $this->mappings['clients'][$client->id], 'account_id' => $account_id, 'type' => 'cc' ]; $this->local->insert('client_account', $vars); }
To
// Set account for autodebit if ($account_id) { try { $vars = [ 'client_id' => $this->mappings['clients'][$client->id], 'account_id' => $account_id, 'type' => 'cc' ]; $this->local->insert('client_account', $vars); } catch (Exception $e) { $this->local->reset(); // Skip duplicated entry continue; } }