Fix test param $id

This commit is contained in:
Laurent Destailleur 2018-09-03 11:56:05 +02:00
parent 6952f346ad
commit 1249e597d4
2 changed files with 10 additions and 5 deletions

View File

@ -111,15 +111,14 @@ if (! empty($id))
dol_syslog("cron_run_jobs.php Bad value for parameter job id", LOG_WARNING);
exit;
}
$filter=array();
$filter['t.rowid']=$id;
}
$result = $object->fetch_all('DESC','t.rowid', 0, 0, 1, $filter, 0);
$result = $object->fetch_all('ASC,ASC,ASC','t.priority,t.entity,t.rowid', 0, 0, 1, $filter, 0);
if ($result<0)
{
echo "Error: ".$cronjob->error;
dol_syslog("cron_run_jobs.php fetch Error".$cronjob->error, LOG_WARNING);
echo "Error: ".$object->error;
dol_syslog("cron_run_jobs.php fetch Error".$object->error, LOG_WARNING);
exit;
}

View File

@ -143,6 +143,12 @@ $object = new Cronjob($db);
$filter=array();
if (! empty($id)) {
if (! is_numeric($id))
{
echo "Error: Bad value for parameter job id";
dol_syslog("cron_run_jobs.php Bad value for parameter job id", LOG_WARNING);
exit;
}
$filter['t.rowid']=$id;
}
@ -162,7 +168,7 @@ foreach($object->lines as $val)
$qualifiedjobs[] = $val;
}
// TODO This sequence of code must be shared with code into public/cron/cron_run_jobs.php php page.
// TODO Duplicate. This sequence of code must be shared with code into public/cron/cron_run_jobs.php php page.
$nbofjobs=count($qualifiedjobs);
$nbofjobslaunchedok=0;