MDL-48008 gradeimport_xml: report errors usefully

This commit is contained in:
Tim Hunt 2014-10-31 19:24:29 +00:00
parent 9ebee5df8e
commit b4a40e451d
2 changed files with 5 additions and 4 deletions

View File

@ -48,7 +48,8 @@ raise_memory_limit(MEMORY_EXTRA);
$text = download_file_content($url);
if ($text === false) {
print_error('cannotreadfile');
print_error('cannotreadfile', 'error',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $url);
}
$error = '';
@ -75,7 +76,6 @@ if ($importcode !== false) {
}
} else {
print_error('error', 'gradeimport_xml');
print_error('errorduringimport', 'gradeimport_xml',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $error);
}

View File

@ -30,6 +30,7 @@ $string['errincorrectgradeidnumber'] = 'Error - idnumber \'{$a}\' from the impor
$string['errincorrectidnumber'] = 'Error - incorrect idnumber';
$string['errincorrectuseridnumber'] = 'Error - idnumber \'{$a}\' from the import file does not match any user.';
$string['error'] = 'Errors occur';
$string['errorduringimport'] = 'An error occurred when trying to import: {$a}';
$string['fileurl'] = 'Remote file URL';
$string['pluginname'] = 'XML file';
$string['xml:publish'] = 'Publish import grades from XML';