]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12840 - gradebook CSV import was failing due to newlines with nothing
authorpoltawski <poltawski>
Tue, 8 Jan 2008 22:25:07 +0000 (22:25 +0000)
committerpoltawski <poltawski>
Tue, 8 Jan 2008 22:25:07 +0000 (22:25 +0000)
on them
merged from MOODLE_19_STABLE

grade/import/csv/index.php

index 2a2cbcbb6122aedc5106ff06fe141eaec2b164ed..30c2a49c123b28c4c6a07a3ed086aba429016a81 100755 (executable)
@@ -222,6 +222,11 @@ if ($formdata = $mform->get_data()) {
             // add something
             $line = split($csv_delimiter, fgets($fp,1024));
 
+            if(count($line) <= 1){
+                // there is no data on this line, move on
+                continue;
+            }
+
             // array to hold all grades to be inserted
             $newgrades = array();
             // array to hold all feedback