Merge branch 'MDL-52319-master-environmentxml' of git://github.com/mudrd8mz/moodle

This commit is contained in:
Andrew Nicols 2020-03-30 14:35:20 +08:00
commit 6eb9705154
2 changed files with 33 additions and 9 deletions

View file

@ -140,6 +140,7 @@ function environment_get_errors($environment_results) {
$type = $environment_result->getPart();
$info = $environment_result->getInfo();
$status = $environment_result->getStatus();
$plugin = $environment_result->getPluginName();
$error_code = $environment_result->getErrorCode();
$a = new stdClass();
@ -209,7 +210,13 @@ function environment_get_errors($environment_results) {
// Append the restrict if there is some
$feedbacktext .= $environment_result->strToReport($environment_result->getRestrictStr(), 'error');
$report .= html_to_text($feedbacktext);
if ($plugin === '') {
$report = '[' . get_string('coresystem') . '] ' . $report;
} else {
$report = '[' . $plugin . '] ' . $report;
}
$report .= ' - ' . html_to_text($feedbacktext);
if ($environment_result->getPart() == 'custom_check'){
$errors[] = array($info, $report);