Fixed two places where course->shortname was harcoded to 15. MDL-10026

This commit is contained in:
stronk7 2007-08-08 19:39:56 +00:00
parent d4795a0792
commit 5ba3928959
2 changed files with 4 additions and 4 deletions

View File

@ -521,8 +521,8 @@
$suffixshort = "";
}
$currentfullname = $fullname.$suffixfull;
// Limit the size of shortname - database column accepts <= 15 chars
$currentshortname = substr($shortname, 0, 15 - strlen($suffixshort)).$suffixshort;
// Limit the size of shortname - database column accepts <= 100 chars
$currentshortname = substr($shortname, 0, 100 - strlen($suffixshort)).$suffixshort;
$coursefull = get_record("course","fullname",addslashes($currentfullname));
$courseshort = get_record("course","shortname",addslashes($currentshortname));
$counter++;

View File

@ -581,8 +581,8 @@ function create_course ($course,$skip_fix_course_sortorder=0){
// truncate a few key fields
$course->idnumber = substr($course->idnumber, 0, 100);
$course->shortname = substr($course->shortname, 0, 15);
$course->shortname = substr($course->shortname, 0, 100);
// store it and log
if ($newcourseid = insert_record("course", addslashes_object($course))) { // Set up new course
$section = NULL;