-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Review Export issues. #29
base: master
Are you sure you want to change the base?
Conversation
$io object referred to nothing. Fixed multiple unwanted version of file creation while exporting review to replace by a single new file.
Fixed unwanted exportData action execution as exportReviews action already creates the export file. Auto file download after export.
Update ExportController.php
Update Csv.php
Revert "Update ExportController.php"
Revert "Revert "Update ExportController.php""
FWIW, in my M 1.9 instance, the export-reviews feature works only after applying the modifications in this PR (including the changes to ExportController.php). |
$file_content = file_get_contents($baseDir . $fileName); | ||
if ($file_content) { | ||
$this->getResponse()->setHeader('Content-type', 'application/csv'); | ||
$this->getResponse()->setBody($file_content); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filename needs to be set in the header in order to be downloaded as "review_export.csv", otherwise it will be downloaded as a generic "download" file without a file extension:
$this->getResponse()->setHeader('Content-Disposition', 'attachment; filename="' . $fileName . '"');
Fixed filename issue for downloaded file.
Fixed review export issue and download file without calling another controller "exportData" action.