Commit 5295b828 authored by Steven Jones's avatar Steven Jones
Browse files

Issue #3459698 by project update bot, steven jones, acbramley, benstallings,...

Issue #3459698 by project update bot, steven jones, acbramley, benstallings, emptyvoid, mably, maxilein, aaronbauman: Automated Drupal 11 compatibility fixes for views_data_export
parent fec5eaba
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -747,7 +747,13 @@ class DataExport extends RestExport {
        $fileSystem = \Drupal::service('file_system');
        $fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY);
        $destination = $directory . $filename;
        if (version_compare(\Drupal::VERSION, '10.3', '>=')) {
          $file = \Drupal::service('file.repository')->writeData('', $destination, FileExists::Replace);
        }
        else {
          // @phpstan-ignore-next-line
          $file = \Drupal::service('file.repository')->writeData('', $destination, FileSystemInterface::EXISTS_REPLACE);
        }
        if (!$file) {
          // Failed to create the file, abort the batch.
          unset($context['sandbox']);