MDL-29563 course Throwing an exception instead of a message

This commit is contained in:
David Monllao 2012-07-17 15:09:19 +08:00
parent 8a1a951f7c
commit 6b4885319b
3 changed files with 3 additions and 8 deletions

View File

@ -61,13 +61,8 @@ $a->modtype = get_string('modulename', $cm->modname);
$a->modname = format_string($cm->name);
if (!plugin_supports('mod', $cm->modname, FEATURE_BACKUP_MOODLE2)) {
echo $output->header();
echo $output->notification(get_string('duplicatenosupport', 'core', $a));
echo $output->continue_button(
new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $course->id))
);
echo $output->footer();
die;
$url = new moodle_url('/course/view.php#section-' . $cm->sectionnum, array('id' => $course->id));
print_error('duplicatenosupport', 'error', $url, $a);
}
// backup the activity

View File

@ -204,6 +204,7 @@ $string['dmlwriteexception'] = 'Error writing to database';
$string['downgradedcore'] = 'ERROR!!! The code you are using is OLDER than the version that made these databases!';
$string['downloadedfilecheckfailed'] = 'Downloaded file check failed';
$string['duplicatefieldname'] = 'Duplicate field name "{$a}" detected';
$string['duplicatenosupport'] = '\'{$a->modname}\' activity could not be duplicated because the {$a->modtype} module does not support backup and restore.';
$string['duplicateparaminsql'] = 'ERROR: duplicate parameter name in query';
$string['duplicaterolename'] = 'There is already a role with this name!';
$string['duplicateroleshortname'] = 'There is already a role with this short name!';

View File

@ -487,7 +487,6 @@ $string['duplicate'] = 'Duplicate';
$string['duplicateconfirm'] = 'Are you sure you want to duplicate {$a->modtype} \'{$a->modname}\' ?';
$string['duplicatecontcourse'] = 'Return to the course';
$string['duplicatecontedit'] = 'Edit the new copy';
$string['duplicatenosupport'] = '\'{$a->modname}\' activity could not be duplicated because the {$a->modtype} module does not support backup and restore.';
$string['duplicatesuccess'] = '{$a->modtype} \'{$a->modname}\' has been duplicated successfully';
$string['duplicatinga'] = 'Duplicating: {$a}';
$string['edhelpaspellpath'] = 'To use spell-checking within the editor, you MUST have <strong>aspell 0.50</strong> or later installed on your server, and you must specify the correct path to access the aspell binary. On Unix/Linux systems, this path is usually <strong>/usr/bin/aspell</strong>, but it might be something else.';