diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index acb27b5dfab..11d6b447c18 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1450,7 +1450,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0, } } } else { - $ok = false; // to avoid false positive + $ok = true; // nothing to delete when glob is on must return ok dol_syslog("No files to delete found", LOG_DEBUG); } } else { diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 8ba6e6d7768..8e258690c6b 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -347,7 +347,7 @@ if ($action == 'updatelines' && $usercancreate) { setEventMessages($error, $errors, 'errors'); } else { $db->commit(); - setEventMessages($langs->trans("ReceptionUpdated"), null); + setEventMessages($langs->trans("ShipmentUpdated"), null); header("Location: ".DOL_URL_ROOT.'/expedition/dispatch.php?id='.$object->id); exit; diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index 357a27462a3..ecfb3a4c4d0 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -63,6 +63,7 @@ NoProductToShipFoundIntoStock=No product to ship found in warehouse %s. C WeightVolShort=Weight/Vol. ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments. NoLineGoOnTabToAddSome=No line, go on tab "%s" to add +ShipmentUpdated=Shipment successfully updated # Sending methods # ModelDocument diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 5e39a0204eb..975257d8be0 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -210,7 +210,7 @@ if ($action == 'remove_file' && $user->hasRight('projet', 'creer')) { $upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($projectstatic->ref)."/".dol_sanitizeFileName($object->ref); $file = $upload_dir.'/'.dol_sanitizeFileName(GETPOST('file')); - $ret = dol_delete_file($file); + $ret = dol_delete_file($file, 1); if ($ret) { setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs'); } else { diff --git a/test/phpunit/FilesLibTest.php b/test/phpunit/FilesLibTest.php index be1365e79c7..6c99fb2cb30 100644 --- a/test/phpunit/FilesLibTest.php +++ b/test/phpunit/FilesLibTest.php @@ -372,7 +372,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase // Again to test there is error when deleting a non existing file with option disableglob $result=dol_delete_file($conf->admin->dir_temp.'/file3.csv', 1, 1); print __METHOD__." result=".$result."\n"; - $this->assertFalse($result, 'delete file that does not exists with disableglo must return ko'); + $this->assertFalse($result, 'delete file that does not exists with disabling glob must return ko'); // Again to test there is no error when deleting a non existing file without option disableglob $result=dol_delete_file($conf->admin->dir_temp.'/file3csv', 0, 1);