Commit 978f386d authored by Darryl Richman's avatar Darryl Richman Committed by Milan Golubovic
Browse files

Issue #3274117 by darrylri, golubovicm: Doesn't correctly import rows with multiline fields

parent fc96329c
Loading
Loading
Loading
Loading
+12 −2
Changes for src/Service/Importer.php: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -75,7 +75,12 @@ class Importer {
      return FALSE;
    }

    $rows = array_map('str_getcsv', file($filepath));
    if ($fh = fopen($filepath, "r")) {
      while ($row = fgetcsv($fh)) {
        $rows[] = $row;
      }
      fclose($fh);
    }
    $header = array_shift($rows);

    // Remove empty lines.
@@ -161,7 +166,12 @@ class Importer {
      return $errors;
    }

    $rows = array_map('str_getcsv', file($filepath));
    if ($fh = fopen($filepath, "r")) {
      while ($row = fgetcsv($fh)) {
        $rows[] = $row;
      }
      fclose($fh);
    }

    $header = array_shift($rows);
    $header_error = NULL;