Bug 22386

Summary: Importing using attributes as matchpoint broken
Product: Koha Reporter: Nick Clemens <nick>
Component: PatronsAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: major    
Priority: P5 - low CC: barton, fridolin.somers, gmcharlt, jonathan.druart, kyle.m.hall, lucas, martin.renvoize
Version: master   
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:
Bug Depends on: 19936    
Bug Blocks:    
Attachments: Bug 22386: Unit tests
Bug 22386: Define patron variable when matchign on extended attributes
Bug 22386: Unit tests
Bug 22386: Define patron variable when matchign on extended attributes
Bug 22386: Unit tests
Bug 22386: Define patron variable when matchign on extended attributes
Bug 22386: Remove debug statements

Description Nick Clemens 2019-02-21 14:27:33 UTC
Attempting to import patrons and matching on extended attributes fails with a software error when matching borrower found
Comment 1 Nick Clemens 2019-02-21 14:33:12 UTC
Created attachment 85447 [details] [review]
Bug 22386: Unit tests
Comment 2 Nick Clemens 2019-02-21 14:33:15 UTC
Created attachment 85448 [details] [review]
Bug 22386: Define patron variable when matchign on extended attributes

For all other methods we define a patron object and check the userid,
we just need to define the $patron here

To test:
0 - Apply unit test patch alone
1 - prove t/db_dependent/Koha/Patrons/Import.t
2 - It dies
3 - Apply this patch
4 - repeat tests
5 - It passes!
Comment 3 Nick Clemens 2019-02-21 14:50:51 UTC
Created attachment 85449 [details] [review]
Bug 22386: Unit tests

Signed-off-by: Devlyn Courtier <dcourtier@hccc.edu>
Comment 4 Nick Clemens 2019-02-21 14:50:53 UTC
Created attachment 85450 [details] [review]
Bug 22386: Define patron variable when matchign on extended attributes

For all other methods we define a patron object and check the userid,
we just need to define the $patron here

To test:
0 - Apply unit test patch alone
1 - prove t/db_dependent/Koha/Patrons/Import.t
2 - It dies
3 - Apply this patch
4 - repeat tests
5 - It passes!

Signed-off-by: Devlyn Courtier <dcourtier@hccc.edu>
Comment 5 Jonathan Druart 2019-02-21 16:24:45 UTC
Error is:
Can't call method "userid" on an undefined value at /home/vagrant/kohaclone/Koha/Patrons/Import.pm line 205, <$handle_4> line 4.
Comment 6 Jonathan Druart 2019-02-21 16:27:13 UTC
Created attachment 85454 [details] [review]
Bug 22386: Unit tests

Signed-off-by: Devlyn Courtier <dcourtier@hccc.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Jonathan Druart 2019-02-21 16:27:18 UTC
Created attachment 85455 [details] [review]
Bug 22386: Define patron variable when matchign on extended attributes

For all other methods we define a patron object and check the userid,
we just need to define the $patron here

To test:
0 - Apply unit test patch alone
1 - prove t/db_dependent/Koha/Patrons/Import.t
2 - It dies
3 - Apply this patch
4 - repeat tests
5 - It passes!

Signed-off-by: Devlyn Courtier <dcourtier@hccc.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Jonathan Druart 2019-02-21 16:27:23 UTC
Created attachment 85456 [details] [review]
Bug 22386: Remove debug statements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Nick Clemens 2019-02-22 15:09:10 UTC
Awesome work all!

Pushed to master for 19.05
Comment 10 Martin Renvoize 2019-02-26 09:21:38 UTC
Pushed to 18.11.x for 18.11.04
Comment 11 Lucas Gass 2019-03-06 23:39:17 UTC
backported to 18.05.x for 18.05.11
Comment 12 Fridolin Somers 2019-03-12 08:18:45 UTC
Depends on Bug 19936 not in 17.11.x
Comment 13 Fridolin Somers 2019-03-26 06:28:46 UTC Comment hidden (obsolete)