Fix travis

This commit is contained in:
Laurent Destailleur
2025-08-26 05:33:23 +02:00
parent 4932cd5f7e
commit ff00f13c8f
3 changed files with 27 additions and 28 deletions

View File

@@ -53,12 +53,12 @@ $action = GETPOST('action', 'aZ09');
*/
$sqllog = '';
$logsql = '';
$resultsql = true;
if ($action == 'convertutf8') {
$sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table);
$sqllog .= $sql.'<br>';
$logsql .= $sql.'<br>';
$resql = $db->query($sql);
if ($resql) {
@@ -68,7 +68,7 @@ if ($action == 'convertutf8') {
$row = $db->fetch_row($resql);
if ($row[0] == $field) {
$sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8"; // We must not sanitize the $row[1]
$sqllog .= $sql.'<br>';
$logsql .= $sql.'<br>';
$db->query($sql);
@@ -79,7 +79,7 @@ if ($action == 'convertutf8') {
}
$sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE ".$db->sanitize($collation); // We must not sanitize the $row[1]
$sqllog .= $sql.'<br>';
$logsql .= $sql.'<br>';
$resql2 = $db->query($sql);
if (!$resql2) {
@@ -94,7 +94,7 @@ if ($action == 'convertutf8') {
}
if ($action == 'convertutf8mb4') {
$sql = "SHOW FULL COLUMNS IN ".$db->sanitize($table);
$sqllog .= $sql.'<br>';
$logsql .= $sql.'<br>';
$resql = $db->query($sql);
if ($resql) {
@@ -104,7 +104,7 @@ if ($action == 'convertutf8mb4') {
$row = $db->fetch_row($resql);
if ($row[0] == $field) {
$sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." CHARACTER SET utf8mb4"; // We must not sanitize the $row[1]
$sqllog .= $sql.'<br>';
$logsql .= $sql.'<br>';
$db->query($sql);
@@ -115,7 +115,7 @@ if ($action == 'convertutf8mb4') {
}
$sql = "ALTER TABLE ".$db->sanitize($table)." MODIFY ".$db->sanitize($row[0])." ".$row[1]." COLLATE ".$db->sanitize($collation); // We must not sanitize the $row[1]
$sqllog .= $sql.'<br>';
$logsql .= $sql.'<br>';
$resql2 = $db->query($sql);
if (!$resql2) {
@@ -140,8 +140,8 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/admin/system/database-tables.php?restore_
print load_fiche_titre($langs->trans("Table")." ".$table, $linkback, 'title_setup');
if ($sqllog) {
print info_admin($sqllog.' '.($resultsql ? ' => OK' : ' => KO '.$db->lasterror()));
if ($logsql) {
print info_admin($logsql.' '.($resultsql ? ' => OK' : ' => KO '.$db->lasterror()));
}
// Define request to get table description