Browse Source

Merge remote-tracking branch 'upstream/7.x-3.x' into 7.x-3.x

dsenalik 4 years ago
parent
commit
ec1f396453
1 changed files with 5 additions and 1 deletions
  1. 5 1
      tripal_bulk_loader/includes/tripal_bulk_loader.loader.inc

+ 5 - 1
tripal_bulk_loader/includes/tripal_bulk_loader.loader.inc

@@ -152,11 +152,15 @@ function tripal_bulk_loader_load_data($nid, $job_id) {
   $node = node_load($nid);
   print "Template: " . $node->template->name . " (" . $node->template_id . ")\n";
 
-  // Determine the total number of lines in the file.
+  // Determine the total number of non-blank lines in the file.
   $total_lines = 0;
   $handle = fopen($node->file, "r");
   while (!feof($handle)) {
     $line = fgets($handle);
+    $line = trim($line);
+    if (empty($line)) {
+      continue;
+    } // skips blank lines
     $total_lines++;
   }
   fclose($handle);