Summary: | Unable to export Withdrawn status using CSV profile | ||
---|---|---|---|
Product: | Koha | Reporter: | Caroline Cyr La Rose <caroline.cyr-la-rose> |
Component: | Tools | Assignee: | Alexis Ripetti <alexis.ripetti> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | aleisha, alexis.ripetti, david, didier.gautheron, jonathan.druart, lucas, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This patch fixes the export of MARC records and the withdrawn status when using CSV profiles. Before this fix the full 952 field was exported, rather than just the withdrawn status.
|
Version(s) released in: |
20.11.00, 20.05.05, 19.11.11
|
Circulation function: | |||
Attachments: |
Bug 26414: Unable to export Withdrawn status using CSV profile
Bug 26414: Unable to export Withdrawn status using CSV profile Bug 26414: Unable to export Withdrawn status using CSV profile Bug 26414: Unable to export Withdrawn status using CSV profile Bug 26414: Unable to export Withdrawn status using CSV profile Bug 26414: Tidy the tests Bug 26414: Tidy the tests |
Description
Caroline Cyr La Rose
2020-09-08 21:44:44 UTC
Created attachment 109970 [details] [review] Bug 26414: Unable to export Withdrawn status using CSV profile When using CSV profiles to export MARC records, it is impossible to export the withdrawn status. I suspect it is because withdrawn is in 952$0 and 0 is considered null rather than an actual 0. Test Plan : 1) Go to Tools > CSV profiles 2) Click on New CSV profile 3) Enter a profile name (ex. Simple record) 4) In the Profile MARC fields field enter the following (for MARC21) 245a|100a|952o|9520 5) Save your profile 6) Go to Search and search for something 7) Add a couple of things in your cart 8) Go to your cart 9) Click on Download and choose your CSV profile 10) Open the file and notice the 9520 column contains the whole of the 952 field and not just the withdrawn status 11) Apply patch 12) Redo steps 9) and 10) hi Why not just a plain my $subfieldtag = $2; and removing the WIP comment with the previous line? Regards Didier Hi Alexis, whenever you plan to work on a patch for a bug, please assign it to yourself using the Asignee field. I've fixed it :) Created attachment 110132 [details] [review] Bug 26414: Unable to export Withdrawn status using CSV profile When using CSV profiles to export MARC records, it is impossible to export the withdrawn status. I suspect it is because withdrawn is in 952$0 and 0 is considered null rather than an actual 0. Test Plan : 1) Go to Tools > CSV profiles 2) Click on New CSV profile 3) Enter a profile name (ex. Simple record) 4) In the Profile MARC fields field enter the following (for MARC21) 245a|100a|952o|9520 5) Save your profile 6) Go to Search and search for something 7) Add a couple of things in your cart 8) Go to your cart 9) Click on Download and choose your CSV profile 10) Open the file and notice the 9520 column contains the whole of the 952 field and not just the withdrawn status 11) Apply patch 12) Redo steps 9) and 10) Signed-off-by: David Nind <david@davidnind.com> Hi Alexis, I believe the tests may need a bit more work to run on different installations: Processing additional checks OK! kohadev-koha@kohadevbox:/home/vagrant/kohaclone$ prove t/db_dependent/Record/marcrecord2csv.t t/db_dependent/Record/marcrecord2csv.t .. 1/13 # Failed test 'normal way: headers retrieved from the DB' # at t/db_dependent/Record/marcrecord2csv.t line 53. # got: '"TITLE STATEMENT"|"SUBJECT ADDED ENTRY--TOPICAL TERM" # "The art of computer programming,Donald E. Knuth.,0;The art of another title,Donald E. Knuth. II,1"|"Computer programming.,462;Computer algorithms.,499" # ' # expected: '"Mention du titre"|Vedette-matière--Sujet # "The art of computer programming,Donald E. Knuth.,0;The art of another title,Donald E. Knuth. II,1"|"Computer programming.,462;Computer algorithms.,499" # ' # Looks like you failed 1 test of 13. t/db_dependent/Record/marcrecord2csv.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/13 subtests Created attachment 110479 [details] [review] Bug 26414: Unable to export Withdrawn status using CSV profile When using CSV profiles to export MARC records, it is impossible to export the withdrawn status. I suspect it is because withdrawn is in 952$0 and 0 is considered null rather than an actual 0. Test Plan : 1) Go to Tools > CSV profiles 2) Click on New CSV profile 3) Enter a profile name (ex. Simple record) 4) In the Profile MARC fields field enter the following (for MARC21) 245a|100a|952o|9520 5) Save your profile 6) Go to Search and search for something 7) Add a couple of things in your cart 8) Go to your cart 9) Click on Download and choose your CSV profile 10) Open the file and notice the 9520 column contains the whole of the 952 field and not just the withdrawn status 11) Apply patch 12) Redo steps 9) and 10) Signed-off-by: David Nind <david@davidnind.com> (In reply to didier from comment #2) > hi > > Why not just a plain > my $subfieldtag = $2; > > and removing the WIP comment with the previous line? > > Regards > Didier Hi, I fixed it. (In reply to Katrin Fischer from comment #5) > Hi Alexis, > > I believe the tests may need a bit more work to run on different > installations: Hi Katrin, I reseted the test that I had changed. The tests should now pass on your installation. Created attachment 110492 [details] [review] Bug 26414: Unable to export Withdrawn status using CSV profile When using CSV profiles to export MARC records, it is impossible to export the withdrawn status. I suspect it is because withdrawn is in 952$0 and 0 is considered null rather than an actual 0. Test Plan : 1) Go to Tools > CSV profiles 2) Click on New CSV profile 3) Enter a profile name (ex. Simple record) 4) In the Profile MARC fields field enter the following (for MARC21) 245a|100a|952o|9520 5) Save your profile 6) Go to Search and search for something 7) Add a couple of things in your cart 8) Go to your cart 9) Click on Download and choose your CSV profile 10) Open the file and notice the 9520 column contains the whole of the 952 field and not just the withdrawn status 11) Apply patch 12) Redo steps 9) and 10) Signed-off-by: David Nind <david@davidnind.com> Created attachment 110515 [details] [review] Bug 26414: Unable to export Withdrawn status using CSV profile When using CSV profiles to export MARC records, it is impossible to export the withdrawn status. I suspect it is because withdrawn is in 952$0 and 0 is considered null rather than an actual 0. Test Plan : 1) Go to Tools > CSV profiles 2) Click on New CSV profile 3) Enter a profile name (ex. Simple record) 4) In the Profile MARC fields field enter the following (for MARC21) 245a|100a|952o|9520 5) Save your profile 6) Go to Search and search for something 7) Add a couple of things in your cart 8) Go to your cart 9) Click on Download and choose your CSV profile 10) Open the file and notice the 9520 column contains the whole of the 952 field and not just the withdrawn status 11) Apply patch 12) Redo steps 9) and 10) Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 110851 [details] [review] Bug 26414: Tidy the tests Created attachment 110852 [details] [review] Bug 26414: Tidy the tests Pushed to master for 20.11, thanks to everybody involved! Congratulations for your first patch pushed, Alexis! :) backported to 20.05.x for 20.05.05 backported to 19.11.x for 19.11.11 Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed. |