diff --git a/src/Plugin/views/display/DataExport.php b/src/Plugin/views/display/DataExport.php index d3d0d41..875ced9 100644 --- a/src/Plugin/views/display/DataExport.php +++ b/src/Plugin/views/display/DataExport.php @@ -304,10 +304,9 @@ public static function processBatch($view_id, $display_id, $args, $exposed_input $items_per_page = $view->getItemsPerPage(); $rendered_rows = $view->render(); - // Workaround for CSV headers, remove the first line and replace with a - // newline. - if ($context['sandbox']['progress'] != 0 && reset($view->getDisplay()->options['formats']) == 'csv') { - $rendered_rows = preg_replace('/^[^\n]+/', "\n", $rendered_rows); + // Workaround for CSV headers, remove the first line. + if ($context['sandbox']['progress'] != 0 && reset($view->getStyle()->options['formats']) == 'csv') { + $rendered_rows = preg_replace('/^[^\n]+/', '', $rendered_rows); } // Write rendered rows to output file.