diff --git a/lib/classes/module/console/taskrun.class.php b/lib/classes/module/console/taskrun.class.php index 25c657525e..99df82261a 100644 --- a/lib/classes/module/console/taskrun.class.php +++ b/lib/classes/module/console/taskrun.class.php @@ -87,14 +87,14 @@ class module_console_taskrun extends Command if ($input->getOption('runner') === task_abstract::RUNNER_MANUAL) { $schedStatus = $task_manager->getSchedulerState(); - if ($schedStatus && $schedStatus['status'] == 'running' && $schedStatus['pid']) { + if ($schedStatus && $schedStatus['status'] == task_abstract::STATE_STARTED && $schedStatus['pid']) { $this->shedulerPID = $schedStatus['pid']; } $runner = task_abstract::RUNNER_MANUAL; } else { $runner = task_abstract::RUNNER_SCHEDULER; $schedStatus = $task_manager->getSchedulerState(); - if ($schedStatus && $schedStatus['status'] == 'running' && $schedStatus['pid']) { + if ($schedStatus && $schedStatus['status'] == task_abstract::STATE_STARTED && $schedStatus['pid']) { $this->shedulerPID = $schedStatus['pid']; } } diff --git a/lib/classes/task/period/archive.class.php b/lib/classes/task/period/archive.class.php index 53bc29a10b..e0f3a75426 100755 --- a/lib/classes/task/period/archive.class.php +++ b/lib/classes/task/period/archive.class.php @@ -1780,7 +1780,7 @@ class task_period_archive extends task_abstract * @param array $nodesToDel out, filled with files to delete * @param integer $grp_rid */ - private function archiveFile(\DOMDocument $dom, \DOMDocument $node, $path, $path_archived, $path_error, array &$nodesToDel, $grp_rid = 0) + private function archiveFile(\DOMDocument $dom, \DOMElement $node, $path, $path_archived, $path_error, array &$nodesToDel, $grp_rid = 0) { $match = $node->getAttribute('match'); @@ -1837,7 +1837,7 @@ class task_period_archive extends task_abstract * @param integer $grp_rid * @param array $nodesToDel out, filled with files to delete */ - private function archiveFileAndCaption(\DOMDOcument$dom, \DOMElement$node, \DOMElement$captionFileNode, $path, $path_archived, $path_error, $grp_rid, array &$nodesToDel) + private function archiveFileAndCaption(\DOMDOcument$dom, \DOMElement $node, \DOMElement $captionFileNode = null, $path, $path_archived, $path_error, $grp_rid, array &$nodesToDel) { $ret = false; @@ -1914,7 +1914,7 @@ class task_period_archive extends task_abstract $this->log($e->getMessage()); } - if ($captionFileName != $file) { + if ($captionFileName != $file && $captionFileName) { $this->log(sprintf(('copy \'%s\' to \'archived\''), $subpath . '/' . $captionFileName)); try { @@ -1942,7 +1942,7 @@ class task_period_archive extends task_abstract $this->log($e->getMessage()); } - if ($captionFileName != $file) { + if ($captionFileName != $file && $captionFileName) { $this->log(sprintf(('copy \'%s\' to \'error\''), $subpath . '/' . $captionFileName)); try {