In checkouts table, the is an export form (when some exports syspref are enabled). Export using a CSV profile will create a file with name koha.mrc (same as ISO2709 export). It would be better with koha.csv. Bug 14647 manages the export page, this but will only manage for export from checkouts table where file name is hard-coded.
Created attachment 56019 [details] [review] Bug 17395 - exporting checkouts in CVS generates a file with wrong extension In checkouts table, the is an export form (when some exports syspref are enabled). Export using a CSV profile will create a file with name koha.mrc (same as ISO2709 export). It would be better with koha.csv. Bug 14647 manages the export page, this but will only manage for export from checkouts table where file name is hard-coded. Test plan : - Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile for record export - Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx - Show checkouts table - Select some checkboxes in "Export" column - Select "CSV" in export format combo-box - Click on "Export" => Without patch, the generated file is koha.mrc => With patch, the generated file is koha.csv - Check ISO2709 export generates a file named koha.mrc
Would not have been better to revive the patch from bug 14647?
(In reply to Jonathan Druart from comment #2) > Would not have been better to revive the patch from bug 14647? Bug 14647 manages exports made by a real user with the page form, it will not manage when export page is called from exporting checkouts : arg filename is not provided so it is then hardcoded. Maybe we can add an hidden input for filename but its more complicated I'd say.
Patch tested with a sandbox, by Fridolin <fsomers@biblibre.com>
(In reply to sandboxes@biblibre.com from comment #4) > Patch tested with a sandbox, by Fridolin <fsomers@biblibre.com> I'm just testing our new sandboxes
(In reply to sandboxes@biblibre.com from comment #6) > Patch tested with a sandbox, by Fridolin <fsomers@biblibre.com> Aborted
Created attachment 56200 [details] [review] Bug 17395 - exporting checkouts in CVS generates a file with wrong extension In checkouts table, the is an export form (when some exports syspref are enabled). Export using a CSV profile will create a file with name koha.mrc (same as ISO2709 export). It would be better with koha.csv. Bug 14647 manages the export page, this but will only manage for export from checkouts table where file name is hard-coded. Test plan : - Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile for record export - Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx - Show checkouts table - Select some checkboxes in "Export" column - Select "CSV" in export format combo-box - Click on "Export" => Without patch, the generated file is koha.mrc => With patch, the generated file is koha.csv - Check ISO2709 export generates a file named koha.mrc Signed-off-by: Dani Elder <dani@bywatersolutions.com>
I do not understand the test plan: the filename is automatically set to "koha.mrc". It looks like we should do this trick using some JS code.
(In reply to Jonathan Druart from comment #9) > I do not understand the test plan: the filename is automatically set to > "koha.mrc". > It looks like we should do this trick using some JS code. I don't see how, but this quick fix is ok no ? Some users may not be aware they must change the file extension, they open it directly from web-browser.
As I said previously, this has to be done in javascript to fill the "File name" input depending on the format the user picked. Currently the behavior is: - "File name" is "koha.mrc" by default - User select csv as the format and pick a csv profile - "File name" is still "koha.mrc" - Click on export => File is named "koha.mrc" (expected) What you want (I suppose): - "File name" is "koha.mrc" by default - User select csv as the format and pick a csv profile - "File name" is changed to "koha.csv" (ideally you only change the extension) - Click on export => File is named "koha.csv"
(In reply to Jonathan Druart from comment #11) > As I said previously, this has to be done in javascript to fill the "File > name" input depending on the format the user picked. Mmmm this is a point of view I think. Fixing in perl is safer in my opinion, it fixes for all calls. > to fill the "File name" input There is actually no such input, create an hidden one you mean ?
Created attachment 57748 [details] [review] Bug 17395 - exporting checkouts in CVS generates a file with wrong extension In checkouts table, the is an export form (when some exports syspref are enabled). Export using a CSV profile will create a file with name koha.mrc (same as ISO2709 export). It would be better with koha.csv. Bug 14647 manages the export page, this but will only manage for export from checkouts table where file name is hard-coded. Test plan : - Enable checkouts exports by setting syspref ExportWithCsvProfile with a profile for record export - Go to circ page of a patron with checkouts : /cgi-bin/koha/circ/circulation.pl?borrowernumber=xxx - Show checkouts table - Select some checkboxes in "Export" column - Select "CSV" in export format combo-box - Click on "Export" => Without patch, the generated file is koha.mrc => With patch, the generated file is koha.csv - Check ISO2709 export generates a file named koha.mrc Signed-off-by: Dani Elder <dani@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Sorry Frido, I mixed it up with the export records tool.
Pushed to master for 17.05, thanks Frido!
Pushed to 3.22.x, will be in 3.22.13
This patch has been pushed to 16.11.x, will be in 16.11.01.