Description of problem:
Generated report file has MIME type text/plain rather than text/csv (as opposed to e.g. exported host list [Hosts -> All Hosts -> Export] which is correctly text/csv).
Version-Release number of selected component (if applicable):
Tried on Sat 6.5 snap 7
Steps to Reproduce:
1. Monitor -> Report Templates
2. Click Generate for some template
Download starts, type is shown as text/plain
Download starts, type is shown as text/csv
For reports that use report_render macro this can be achieved quite easily. For any custom report, this is hard to autodetect as the result does not have to be csv. We'd need let user specify the mime type on template level or even during generating the report. It would probably have to be free text field. Let's limit scope of this RFE to only reports shipped in the product which all use the macro.
Created redmine issue https://projects.theforeman.org/issues/25732 from this bug
Upstream bug assigned to email@example.com
*** Bug 1677618 has been marked as a duplicate of this bug. ***
*** Bug 1700009 has been marked as a duplicate of this bug. ***
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25732 has been resolved.
This BZ is similar to bug 170062 which I failed. I'm failing this one for the same reasons:
This basically works, but there are issues for templates that don't use the report_render macro:
1) Downloaded files have the file extension of ".text" rather than expected ".txt"
2) The format selection field is greyed out (as expected) with the value of "CSV" selected (which is confusing, the resulting file is not a CSV)
3) I think it should be possible to set MIME type to all reports, not just those that contain string "report_render" - even if it doesn't change the actual file contents, the MIME type and extension should be selectable (for instance to tell the browser how to treat the downloaded file)
Also, I think it should be possible to select TXT format. It's not possible now and I'd go as far as calling it regression because previous versions (only) supported generating .txt reports.
One more point, Marek mentioned he wants available formats to be a property of each template. This is not the case.
* bug 1701062
After discussion with Marek, I am verifying this and filing a BZ against 1) because while there is no standard specifying text file extension, ".txt" is commonly used.
Marek narrowed the scope of this BZ to only those shipped with Satellite in comment 3. All the shipped reports use macro report_render. Points 1, 2, 3 are all about macros that don't use it. Also, point 3) can be bypassed by writing the macro in a comment.
Furthermore, while the behavior change might be unexpected and I think it would be better to allow TXT format to be selected, it's OK to remove this behavior in favor of the enhancement.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.