Note the plural, you can import 1 patron without a cardnumber, it defaults to an empty string The next patron cannot be imported because empty string is already in use Will attach sample file
Created attachment 90415 [details] [review] Bug 23077 - Unit tests prove -v t/db_dependent/Koha/Patrons/Import.t
Created attachment 90416 [details] [review] Bug 23077 - Don't fill cardnumber with empty string To test: 1 - Apply unit test patch only 2 - prove the tests, they fail 3 - Attempt to import the attached sample file 4 - First patron may be imported, second will give error (or both will error) 5 - If only one error, import agian, now both have error 6 - Apply this patch 7 - Prove tests, they pass! 8 - Import the sample file 9 - It succeeds!
Created attachment 90417 [details] Sample import file
Created attachment 90418 [details] Sample file
Created attachment 90474 [details] [review] [SIGNED-OFF] Bug 23077 - Unit tests prove -v t/db_dependent/Koha/Patrons/Import.t Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Created attachment 90475 [details] [review] [SIGNED-OFF] Bug 23077 - Don't fill cardnumber with empty string To test: 1 - Apply unit test patch only 2 - prove the tests, they fail 3 - Attempt to import the attached sample file 4 - First patron may be imported, second will give error (or both will error) 5 - If only one error, import agian, now both have error 6 - Apply this patch 7 - Prove tests, they pass! 8 - Import the sample file 9 - It succeeds! Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
QA tool is not happy: OK Koha/Patrons/Import.pm FAIL t/db_dependent/Koha/Patrons/Import.t FAIL forbidden patterns forbidden pattern: Data::Dumper::Dumper (line 400) Processing additional checks * Commit title does not start with 'Bug XXXXX: ' - 033eec3a20 * Commit title does not start with 'Bug XXXXX: ' - 79dd7b20d2 And the patch introduces a minor behaviour change: on master I can import a patron with cardnumber '0', with the patch I can't
Created attachment 91181 [details] [review] Bug 23077: Unit tests prove -v t/db_dependent/Koha/Patrons/Import.t Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Created attachment 91182 [details] [review] Bug 23077: Don't fill cardnumber with empty string To test: 1 - Apply unit test patch only 2 - prove the tests, they fail 3 - Attempt to import the attached sample file 4 - First patron may be imported, second will give error (or both will error) 5 - If only one error, import agian, now both have error 6 - Apply this patch 7 - Prove tests, they pass! 8 - Import the sample file 9 - It succeeds! Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Created attachment 91183 [details] [review] Bug 23077: Fix import of cardnumber 0
Created attachment 91315 [details] [review] Bug 23077: Unit tests prove -v t/db_dependent/Koha/Patrons/Import.t Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 91316 [details] [review] Bug 23077: Don't fill cardnumber with empty string To test: 1 - Apply unit test patch only 2 - prove the tests, they fail 3 - Attempt to import the attached sample file 4 - First patron may be imported, second will give error (or both will error) 5 - If only one error, import agian, now both have error 6 - Apply this patch 7 - Prove tests, they pass! 8 - Import the sample file 9 - It succeeds! Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 91317 [details] [review] Bug 23077: Fix import of cardnumber 0 Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.03
backported to 18.11.x for 18.11.09
*** Bug 14601 has been marked as a duplicate of this bug. ***