MDL-74141 tool_task: Display error when Path to CLI not defined

When "Path to PHP CLI" is not defined, an exception with the message
in cannotfindthepathtothecli should be displayed, and the page should
be redirected to System paths settings page.

Apart from that, this patch also replaced core_task to tool_task,
because this message wasn't traslated properly.
This commit is contained in:
Sara Arjona
2022-03-10 16:19:07 +01:00
parent 01eb6d2e9b
commit 730bc8735e
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -1116,7 +1116,7 @@ class manager {
if (!self::is_runnable()) {
$redirecturl = new \moodle_url('/admin/settings.php', ['section' => 'systempaths']);
throw new \moodle_exception('cannotfindthepathtothecli', 'core_task', $redirecturl->out());
throw new \moodle_exception('cannotfindthepathtothecli', 'tool_task', $redirecturl->out());
} else {
// Shell-escaped path to the PHP binary.
$phpbinary = escapeshellarg(self::find_php_cli_path());