Loading .gitlab-ci.yml +3 −0 Original line number Diff line number Diff line Loading @@ -26,3 +26,6 @@ include: variables: # CSpell was picking up too many false positives, so disable. SKIP_CSPELL: '1' # We want to test in Drupal 10 too. OPT_IN_TEST_PREVIOUS_MAJOR: 1 src/Plugin/views/display/DataExport.php +3 −2 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\views_data_export\Plugin\views\display; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\CacheableResponse; use Drupal\Core\Config\StorageException; use Drupal\Core\File\FileExists; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\BubbleableMetadata; Loading Loading @@ -746,7 +747,7 @@ class DataExport extends RestExport { $fileSystem = \Drupal::service('file_system'); $fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY); $destination = $directory . $filename; $file = \Drupal::service('file.repository')->writeData('', $destination, FileSystemInterface::EXISTS_REPLACE); $file = \Drupal::service('file.repository')->writeData('', $destination, FileExists::Replace); if (!$file) { // Failed to create the file, abort the batch. unset($context['sandbox']); Loading Loading @@ -835,7 +836,7 @@ class DataExport extends RestExport { $rowIndex++; $colIndex = 0; foreach ($row->getCellIterator() as $cell) { $previousExcel->getActiveSheet()->setCellValueByColumnAndRow(++$colIndex, $rowIndex, $cell->getValue()); $previousExcel->getActiveSheet()->setCellValue([++$colIndex, $rowIndex], $cell->getValue()); } } Loading tests/src/Functional/ViewsDataExportBatchTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -2,11 +2,11 @@ namespace Drupal\Tests\views_data_export\Functional; use Drupal\csv_serialization\Encoder\CsvEncoder; use Drupal\Tests\node\Traits\ContentTypeCreationTrait; use Drupal\Tests\node\Traits\NodeCreationTrait; use Drupal\Tests\search_api\Functional\ExampleContentTrait; use Drupal\Tests\views\Functional\ViewTestBase; use Drupal\csv_serialization\Encoder\CsvEncoder; /** * Tests views data export with batch. Loading views_data_export.info.yml +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ name: 'Views Data Export' type: module description: 'Plugin to export views data into various file formats.' package: 'Views' core_version_requirement: ^9 || ^10 core_version_requirement: ^9 || ^10 || ^11 dependencies: - drupal:rest - drupal:views Loading Loading
.gitlab-ci.yml +3 −0 Original line number Diff line number Diff line Loading @@ -26,3 +26,6 @@ include: variables: # CSpell was picking up too many false positives, so disable. SKIP_CSPELL: '1' # We want to test in Drupal 10 too. OPT_IN_TEST_PREVIOUS_MAJOR: 1
src/Plugin/views/display/DataExport.php +3 −2 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ namespace Drupal\views_data_export\Plugin\views\display; use Drupal\Core\Cache\CacheableMetadata; use Drupal\Core\Cache\CacheableResponse; use Drupal\Core\Config\StorageException; use Drupal\Core\File\FileExists; use Drupal\Core\File\FileSystemInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\BubbleableMetadata; Loading Loading @@ -746,7 +747,7 @@ class DataExport extends RestExport { $fileSystem = \Drupal::service('file_system'); $fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY); $destination = $directory . $filename; $file = \Drupal::service('file.repository')->writeData('', $destination, FileSystemInterface::EXISTS_REPLACE); $file = \Drupal::service('file.repository')->writeData('', $destination, FileExists::Replace); if (!$file) { // Failed to create the file, abort the batch. unset($context['sandbox']); Loading Loading @@ -835,7 +836,7 @@ class DataExport extends RestExport { $rowIndex++; $colIndex = 0; foreach ($row->getCellIterator() as $cell) { $previousExcel->getActiveSheet()->setCellValueByColumnAndRow(++$colIndex, $rowIndex, $cell->getValue()); $previousExcel->getActiveSheet()->setCellValue([++$colIndex, $rowIndex], $cell->getValue()); } } Loading
tests/src/Functional/ViewsDataExportBatchTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -2,11 +2,11 @@ namespace Drupal\Tests\views_data_export\Functional; use Drupal\csv_serialization\Encoder\CsvEncoder; use Drupal\Tests\node\Traits\ContentTypeCreationTrait; use Drupal\Tests\node\Traits\NodeCreationTrait; use Drupal\Tests\search_api\Functional\ExampleContentTrait; use Drupal\Tests\views\Functional\ViewTestBase; use Drupal\csv_serialization\Encoder\CsvEncoder; /** * Tests views data export with batch. Loading
views_data_export.info.yml +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ name: 'Views Data Export' type: module description: 'Plugin to export views data into various file formats.' package: 'Views' core_version_requirement: ^9 || ^10 core_version_requirement: ^9 || ^10 || ^11 dependencies: - drupal:rest - drupal:views Loading