Fix data next run of a job mandatory only if status is enabled

This commit is contained in:
Laurent Destailleur 2023-03-30 12:42:39 +02:00
parent 777b451316
commit 5cf1ed058f

View File

@ -741,7 +741,7 @@ class Cronjob extends CommonObject
// Check parameters // Check parameters
// Put here code to add a control on parameters values // Put here code to add a control on parameters values
if (dol_strlen($this->datenextrun) == 0) { if (dol_strlen($this->datenextrun) == 0 && $this->status == self::STATUS_ENABLED) {
$this->errors[] = $langs->trans('CronFieldMandatory', $langs->transnoentitiesnoconv('CronDtNextLaunch')); $this->errors[] = $langs->trans('CronFieldMandatory', $langs->transnoentitiesnoconv('CronDtNextLaunch'));
$error++; $error++;
} }