Skip to content

Commit

Permalink
Added the functionality of create a course category if the category d…
Browse files Browse the repository at this point in the history
…oesn't exist when importing courses - Refs #8170
  • Loading branch information
jloguercio committed May 11, 2016
1 parent 36e5249 commit 5a490b3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main/admin/course_import.php
Expand Up @@ -65,9 +65,7 @@ function validate_data($courses)
if (isset($course['CourseCategory']) && strlen($course['CourseCategory']) != 0) {
$categoryInfo = CourseCategory::getCategory($course['CourseCategory']);
if (empty($categoryInfo)) {
//@todo this is so bad even all lang variables are wrong ...
$course['error'] = get_lang('UnkownCategoryCourseCode').' ('.$course['CourseCategory'].')';
$errors[] = $course;
CourseCategory::addNode($course['CourseCategory'], $course['CourseCategory'], 'TRUE', null);
}
}
}
Expand Down

0 comments on commit 5a490b3

Please sign in to comment.