diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 896d6964bdd..1ad1beca350 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -1079,15 +1079,28 @@ if ($ok && GETPOST('force_utf8_on_tables','alpha')) if ($db->type == "mysql" || $db->type == "mysqli") { - $listoftables = $db->DDLListTables($db->database_name); + $force_utf8_on_tables = GETPOST('force_utf8_on_tables','alpha'); + + $listoftables = $db->DDLListTables($db->database_name); + + // Disable foreign key checking for avoid errors + if ($force_utf8_on_tables == 'confirmed') + { + $sql='SET FOREIGN_KEY_CHECKS=0'; + print ''; + $resql = $db->query($sql); + } foreach($listoftables as $table) { + // do not convert llx_const if mysql encrypt/decrypt is used + if ($conf->db->dolibarr_main_db_encryption != 0 && preg_match('/\_const$/', $table)) continue; + print '