mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
"MDL-14129, fix print_error call under course/, see tracker"
This commit is contained in:
parent
211c6890c5
commit
ba6018a902
17 changed files with 146 additions and 117 deletions
|
@ -19,7 +19,7 @@
|
|||
$context = $sysctx;
|
||||
|
||||
if (!$site = get_site()) {
|
||||
print_error('Site isn\'t defined!');
|
||||
print_error('siteisnotdefined', 'debug');
|
||||
}
|
||||
|
||||
if ($CFG->forcelogin) {
|
||||
|
@ -120,7 +120,7 @@
|
|||
if ($childcats = get_records('course_categories', 'parent', $deletecat->id)) {
|
||||
foreach ($childcats as $childcat) {
|
||||
if (! set_field('course_categories', 'parent', $deletecat->parent, 'id', $childcat->id)) {
|
||||
print_error('Could not update a child category!', 'index.php');
|
||||
print_error('cannotupdatesubcate', '', 'index.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -131,7 +131,7 @@
|
|||
if ($childcourses = get_records('course', 'category', $deletecat->id)) {
|
||||
foreach ($childcourses as $childcourse) {
|
||||
if (! set_field('course', 'category', $deletecat->parent, 'id', $childcourse->id)) {
|
||||
print_error('Could not update a child course!', 'index.php');
|
||||
print_error('cannotupdatesubcourse', '', 'index.php');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@
|
|||
unset($tempcat);
|
||||
$tempcat->name = get_string('miscellaneous');
|
||||
if (!$tempcat->id = insert_record('course_categories', $tempcat)) {
|
||||
print_error('Serious error: Could not create a default category!');
|
||||
print_error('cannotsetupcategory');
|
||||
}
|
||||
$tempcat->context = get_context_instance(CONTEXT_COURSECAT, $tempcat->id);
|
||||
mark_context_dirty('/'.SYSCONTEXTID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue