Skip to content

Commit

Permalink
Fix #2 Avoid PHP error in logs when computeLateOrder cron runs
Browse files Browse the repository at this point in the history
Fix #3 ComputeLatOrder cronstask not created at install
  • Loading branch information
Walid committed Aug 8, 2015
1 parent a60a7a9 commit c73369a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion inc/order.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1833,7 +1833,7 @@ public static function cronComputeLateOrders($task) {

$cron_status = 1;
if ($CFG_GLPI["use_mailing"]) {
$message = array();
$message = __("Order is late", "order");
$alert = new Alert();
$config = PluginOrderConfig::getConfig();

Expand Down Expand Up @@ -2079,6 +2079,10 @@ public static function install(Migration $migration) {
KEY date_mod (date_mod)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
$DB->query($query) or die ($DB->error());

Crontask::Register(__CLASS__, 'computeLateOrders', HOUR_TIMESTAMP,
array('param' => 24, 'mode' => CronTask::MODE_EXTERNAL));

} else {
//Upgrade
$migration->displayMessage("Upgrading $table");
Expand Down

0 comments on commit c73369a

Please sign in to comment.