Summary: | Framework export module should escape double quotes | ||
---|---|---|---|
Product: | Koha | Reporter: | Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski> |
Component: | System Administration | Assignee: | Baptiste Wojtkowski (bwoj) <baptiste.wojtkowski> |
Status: | Pushed to main --- | QA Contact: | Chris Cormack <chris> |
Severity: | normal | ||
Priority: | P5 - low | CC: | gmcharlt, martin.renvoize, sukhmandeep.benipal |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
24.11.00
|
|
Circulation function: | |||
Attachments: |
Bug 37606 - Fix framework export module to replace double quotes with simple quotes
Bug 37606 - Fix framework export module to escape double quotes Bug 37606 - Fix framework export module to escape double quotes Bug 37606 - Fix framework export module to escape double quotes Bug 37606: Fix framework export module to escape double quotes |
Description
Baptiste Wojtkowski (bwoj)
2024-08-09 14:46:07 UTC
Created attachment 170199 [details] [review] Bug 37606 - Fix framework export module to replace double quotes with simple quotes When exporting a framework as csv, the exporter does not check the presence of double quote in the fields. Hence, if there is one double quote, the csv is broken. TEST PLAN: 1 - Change a framework to add a field containing double quote in name 2 - Export it in csv 3 - Create a new framework 4 - Import the csv in the new framework -> every fields after the one containing double quotes should have no subfields 5 - APPLY PATCH 6 - Repeat 2-5 -> everything should be correctly exported Created attachment 170200 [details] [review] Bug 37606 - Fix framework export module to escape double quotes When exporting a framework as csv, the exporter does not check the presence of double quote in the fields. Hence, if there is one double quote, the csv is broken. TEST PLAN: 1 - Change a framework to add a field containing double quote in name 2 - Export it in csv 3 - Create a new framework 4 - Import the csv in the new framework -> every fields after the one containing double quotes should have no subfields 5 - APPLY PATCH 6 - Repeat 2-5 -> everything should be correctly exported NOTE: CSV exports should all use the same lib, I'll try and fix it once I have some time Hi Baptiste, I'm having some trouble following the test plan. Could you break down the steps a bit more? Also, which framework are we referring to? I'm guessing the MARC bibliographic framework, but I'm not sure. Thanks! Hi ! Thanks for paying attention to this patch ! :) For the 1, go in Administration -> MARC bibliographic frameworks, pick any framework by clicking action->marc structure (default framework is fine) and in a field of your choice, add double quotes (check that there are fields with subfields after the modified one by clicking on action->view subfields). Then you go back to the framework list for the 2, click on actions-> export-> csv 3 - click on new framework and fill in the form 4 - on the created framework, click on actions -> import, and pick the generated csv. Then, check the imported framework, the last fields will have no subfields. I tried to recreate the issue, but the results I obtained do not match those described in the test plan. For the step: 4 - Import the CSV in the new framework Expected Behavior: Every field after the one containing double quotes should have no subfields. Observed Results: - All the fields after the one containing double quotes, including the field with the double quotes, were not present in the new framework. - The fields before the one with the double quotes had no subfields. After applying the patch, everything seems to be working correctly. All fields are now present with their appropriate subfields. Note: I am not sure if the issue can be signed off. Oh yes sorry, I described the behaviour if you modify a subfield to add a double quote. It is due to the way it is imported. It imports every fields then every subfields. If you break the field, it will break every field after and every subfield. If you break a subfield, it will break every subfield after. Created attachment 171343 [details] [review] Bug 37606 - Fix framework export module to escape double quotes When exporting a framework as csv, the exporter does not check the presence of double quote in the fields. Hence, if there is one double quote, the csv is broken. TEST PLAN: 1 - Change a framework to add a field containing double quote in name 2 - Export it in csv 3 - Create a new framework 4 - Import the csv in the new framework -> every fields after the one containing double quotes should be broke. Every other fields should have no subfield 5 - APPLY PATCH 6 - Repeat 2-5 -> everything should be correctly exported Created attachment 171344 [details] [review] Bug 37606 - Fix framework export module to escape double quotes When exporting a framework as csv, the exporter does not check the presence of double quote in the fields. Hence, if there is one double quote, the csv is broken. TEST PLAN: 1 - Change a framework to add a field containing double quote in name 2 - Export it in csv 3 - Create a new framework 4 - Import the csv in the new framework -> every fields after the one containing double quotes should be broke. Every other fields should have no subfield 5 - APPLY PATCH 6 - Repeat 2-5 -> everything should be correctly exported Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com> Created attachment 172934 [details] [review] Bug 37606: Fix framework export module to escape double quotes When exporting a framework as csv, the exporter does not check the presence of double quote in the fields. Hence, if there is one double quote, the csv is broken. TEST PLAN: 1 - Change a framework to add a field containing double quote in name 2 - Export it in csv 3 - Create a new framework 4 - Import the csv in the new framework -> every fields after the one containing double quotes should be broke. Every other fields should have no subfield 5 - APPLY PATCH 6 - Repeat 2-5 -> everything should be correctly exported Signed-off-by: Sukhmandeep Benipal <sukhmandeep.benipal@inLibro.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Pushed for 24.11! Well done everyone, thank you! |