diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 63f8df2b563..f0b235b34c0 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -917,7 +917,7 @@ class Documents extends DolibarrApi // Move the temporary file at its final emplacement $result = dol_move($destfiletmp, $dest_file, 0, $overwriteifexists, 1, 1, $moreinfo); if (!$result) { - throw new RestException(500, "Failed to move file into '".$destfile."'"); + throw new RestException(500, "Failed to move file into '".$dest_file."'"); } return dol_basename($destfile); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index f0c399c3305..19e40b7b6bf 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1732,7 +1732,7 @@ if ($action == 'create') { $line = new ContratLigne($db); $line->id = $objp->rowid; $line->fetch_optionals(); - print $line->showOptionals($extrafields, 'view', array('class'=>'oddeven', 'style'=>$moreparam, 'colspan'=>$colspan), '', '', 1); + print $line->showOptionals($extrafields, 'view', array('class'=>'oddeven', 'style'=>$moreparam, 'colspan'=>$colspan, 'tdclass' => 'notitlefieldcreate'), '', '', 1); } } else { // Line in mode update @@ -1836,7 +1836,7 @@ if ($action == 'create') { $line = new ContratLigne($db); $line->id = $objp->rowid; $line->fetch_optionals(); - print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', 1); + print $line->showOptionals($extrafields, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan, 'tdclass' => 'notitlefieldcreate'), '', '', 1); } } diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index db720901302..f800bed7921 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -544,13 +544,13 @@ class Utils } elseif ($compression == 'zstd') { fclose($handle); } - if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error + if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg) || preg_match('/^\/\*M?!999999/', $errormsg)) { // Start of file is ok, NOT an error $errormsg = ''; } else { - // Renommer fichier sortie en fichier erreur + // Rename file out into a file error //print "$outputfile -> $outputerror"; @dol_delete_file($outputerror, 1, 0, 0, null, false, 0); - @rename($outputfile, $outputerror); + @dol_move($outputfile, $outputerror, '0', 1, 0, 0); // Si safe_mode on et command hors du parametre exec, on a un fichier out vide donc errormsg vide if (!$errormsg) { $langs->load("errors");