I had the same problem in my version 1.18.1:
- I saw a white popup, without text and I didn't notice that the file was correctly sent to me via email.
- also on line 2068 I had: "@$exporter->delete();" instead of "$exporter->delete();".
I made the suggested changes and now:
- the file is correctly exported to the browser.
- the popup is no longer white and without text but shows the courtesy text.
File edited on the image: \include\ajax.tickets.php
Code from image 1:
try {
$interval = 5;
$options = ['filename' => $filename,
'interval' => $interval, 'delimiter' => $_POST['csv-delimiter']];
// Create desired exporter
$exporter = new CsvExporter($options);
// Acknowledge the export
$exporter->ack();
// Phew... now we're free to do the export
// Ask the queue to export to the exporter
$queue->export($exporter);
$exporter->finalize();
// Email the export if it exists
$exporter->email($thisstaff);
// Delete the file.
$exporter->delete();
exit;
} catch (Exception $ex) {
$errors['err'] = __('Unable to prepare the export');
}
Code from image 2:
try {
$interval = 5;
$options = ['filename' => $filename, 'interval' => $interval, 'delimiter' => $_POST['csv-delimiter']];
// Create desired exporter
$exporter = new CsvExporter($options);
// Acknowledge the export
$exporter->ack();
// Phew... now we're free to do the export
// Ask the queue to export to the exporter
$queue->export($exporter);
// Finalize the export process
$exporter->finalize();
// Email the export if it exists
if ($exporter->exportExists()) {
$exporter->email($thisstaff);
} else {
// Handle the case where the export file doesn't exist
// This could be due to an error during the export process
throw new Exception("Export file doesn't exist.");
}
// Delete the file after emailing
$exporter->delete();
exit;
} catch (Exception $e) {
// Handle any exceptions that occur during the export process
// Log the error or display an error message to the user
echo "An error occurred: " . $e->getMessage();
}