Skip to content

Commit

Permalink
Fix test param $id
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Sep 3, 2018
1 parent 6952f34 commit 1249e59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 3 additions & 4 deletions htdocs/public/cron/cron_run_jobs.php
Expand Up @@ -111,15 +111,14 @@
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;
}

Expand Down
8 changes: 7 additions & 1 deletion scripts/cron/cron_run_jobs.php
Expand Up @@ -143,6 +143,12 @@

$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;
}

Expand All @@ -162,7 +168,7 @@
$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;
Expand Down

0 comments on commit 1249e59

Please sign in to comment.