]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed two places where course->shortname was harcoded to 15. MDL-10026
authorstronk7 <stronk7>
Wed, 8 Aug 2007 19:39:56 +0000 (19:39 +0000)
committerstronk7 <stronk7>
Wed, 8 Aug 2007 19:39:56 +0000 (19:39 +0000)
backup/restorelib.php
enrol/database/enrol.php

index c198454c2fc892cdd82216dbee849826efcf5b42..cb1e8a22dfaca47e9ef587a785225bbd2f88b93c 100644 (file)
                 $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++;
index 1b3a22af171d026a1298a542cb139473a40abc51..f51c7127ff8fdde2f9f3494e6a3f8246ce28ecd3 100644 (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;