Skip to content
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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

SudipBishwakarma
Copy link

Fixed review export issue and download file without calling another controller "exportData" action.

$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.
Revert "Update ExportController.php"
Revert "Revert "Update ExportController.php""
@kmdsax
Copy link

kmdsax commented Apr 25, 2018

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);
Copy link

@kmdsax kmdsax Apr 25, 2018

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants