Description
Kyle M Hall (khall)
2021-03-05 15:18:58 UTC
Created attachment 117861 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Sorry, I can't get this to work! The interface says that my CSV has been imported successfully and that my patron was overwritten, but the expected changes are not made to the existing record. The QA tool shows this failure: FAIL misc/import_patrons.pl FAIL critic # Variables::ProhibitUnusedVariables: Got 1 violation(s). FAIL valid Global symbol "@preserve_fields" requires explicit package name (did you forget to declare "my @preserve_fields"?) Global symbol "@preserve_fields" requires explicit package name (did you forget to declare "my @preserve_fields"?) misc/import_patrons.pl had compilation errors. Created attachment 119018 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Created attachment 119227 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Created attachment 119228 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Created attachment 119229 [details] [review] Bug 27883: (QA follow-up) Fix missing variable rename Created attachment 119230 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Created attachment 119231 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 119366 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Created attachment 119367 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 119370 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Created attachment 119371 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 119436 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Signed-off-by: David Nind <david@davidnind.com> Created attachment 119437 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 121883 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Signed-off-by: David Nind <david@davidnind.com> Created attachment 121884 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Created attachment 122719 [details] [review] Bug 27883: Add ability to preserve patron field from being overwritten by import Some libraries would like to be able to preserve particular fields for existing patrons when overwriting them via the patron import tool. Effectively, this means the specified columns of the CSV are used for new patrons, but ignored for existing patrons. Test Plan: 1) Create a patron CSV with one new patron, make the surname and firstname "Test1". Add a cardnumber so we can upload it again later. 2) Import the file 3) Change the firstname and surname in the CSV to "Test2" 4) Return to the patron import tool, choose to match on cardnumber, overwrite existing patrons, and preserve exiting firstnames 5) Import the file with these settings 6) Referesh the patron details for this patron, the patron's surname should still be "Test" while the firstname should now be "Test2" Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Created attachment 122720 [details] [review] Bug 27883: (follow-up) Make label match input id This change alters the list of columns under "Preserve existing values," changing the label for each checkbox can be clicked to trigger the checkbox change. To test, apply the patch and refresh the patron import page. Expand the "Preserve existing values" section and click any label in the list. The corresponding checkbox should be checked. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Code checks out ok, feature works as expected. Tests included and passing,QA script is happy. Passing QA Pushed to master for 21.11, thanks to everybody involved! Enhancement not backported to 21.05 (In reply to Kyle M Hall from comment #22) > Enhancement not backported to 21.05 There is something odd going on here. Strings from this have showed up in 21.05 translations I did today? (In reply to Katrin Fischer from comment #24) > https://translate.koha-community.org/de/21.05/translate/ > #search=Preserve%20existing%20values&sfields=source,target Turned out to be a mistake on creating the po files - Koha codebase is ok and po files are now too :) This is causing the following warning: [2021/12/14 14:12:13] [WARN] CGI::param called in list context from /kohadevbox/koha/tools/import_borrowers.pl line 94, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 412. *** Bug 24115 has been marked as a duplicate of this bug. *** |