Fix FK error when deleting a user

Table "c_lp_category_user" (appeared while doing behat tests).
remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 7985cf192d
commit 82b557e80b
  1. 6
      main/inc/lib/usermanager.lib.php

@ -739,6 +739,12 @@ class UserManager
TicketManager::deleteUserFromTicketSystem($user_id);
}
$tableExists = $connection->getSchemaManager()->tablesExist(['c_lp_category_user']);
if ($tableExists) {
$sql = "DELETE FROM c_lp_category_user WHERE user_id = $user_id";
Database::query($sql);
}
// Delete user from database
$sql = "DELETE FROM $table_user WHERE id = '".$user_id."'";
Database::query($sql);

Loading…
Cancel
Save