Bug 17741

Summary: Use Koha::Patron->holds in Koha::Patron->delete
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low CC: chris.kirby, katrin.fischer, kyle, m.de.rooy
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17740    
Bug Blocks:    
Attachments: Bug 17741: Use Koha::Patron->holds when deleting a patron
[SIGNED-OFF] Bug 17741: Use Koha::Patron->holds when deleting a patron
Bug 17741: Use Koha::Patron->holds when deleting a patron

Description Jonathan Druart 2016-12-07 16:33:39 UTC
There is a TODO in Koha::Patron->delete, this method should call the Koha::Patron->holds to retrieve the holds made by the patron we are removing instead of calling Koha::Holds->search
Comment 1 Jonathan Druart 2016-12-07 16:35:21 UTC
Created attachment 58022 [details] [review]
Bug 17741: Use Koha::Patron->holds when deleting a patron

There is a TODO in Koha::Patron->delete, this method should call the
Koha::Patron->holds to retrieve the holds made by the patron we are
removing instead of calling Koha::Holds->search

Test plan:
  prove t/db_dependent/Koha/Patrons.t
Should return green
Comment 2 Josef Moravec 2016-12-07 22:03:09 UTC
Created attachment 58034 [details] [review]
[SIGNED-OFF] Bug 17741: Use Koha::Patron->holds when deleting a patron

There is a TODO in Koha::Patron->delete, this method should call the
Koha::Patron->holds to retrieve the holds made by the patron we are
removing instead of calling Koha::Holds->search

Test plan:
  prove t/db_dependent/Koha/Patrons.t
Should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 3 Chris Kirby 2016-12-08 18:33:15 UTC
I tested this too, but I get "Compilation failed in require at Koha/ArticleRequest.pm" and "Compilation failed in require at Koha/Patron.pm" errors. And the tests fail.
Comment 4 Chris Kirby 2016-12-09 17:52:21 UTC
I have updated my packages. Now I get "Parse errors: Bad plan. You planned 15 tests but ran 9." "Failed test 'No tests run for subtest "is_going_to_expire"'
The method is_going_to_expire_expire is not covered by tests!"
Comment 5 Chris Kirby 2016-12-09 17:56:37 UTC
Within the staff client, when I delete a patron with a hold, I get a "The method holds is not covered by tests!" error message.
Comment 6 Jonathan Druart 2016-12-12 10:02:26 UTC
Everything looks ok for me, please apply the dependencies first.
Comment 7 Marcel de Rooy 2017-01-06 09:20:43 UTC
Created attachment 58627 [details] [review]
Bug 17741: Use Koha::Patron->holds when deleting a patron

There is a TODO in Koha::Patron->delete, this method should call the
Koha::Patron->holds to retrieve the holds made by the patron we are
removing instead of calling Koha::Holds->search

Test plan:
  prove t/db_dependent/Koha/Patrons.t
Should return green

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 8 Kyle M Hall 2017-01-13 11:40:16 UTC
Pushed to master for 17.05, thanks Jonathan!
Comment 9 Katrin Fischer 2017-01-15 17:24:19 UTC
This won't get ported back to 16.11.x as it is an enhancement.