Created attachment 52929 [details] [review] Bug 16819: Unit tests for C4::Members::DelMember The C4::Members::DelMember function actually deletes reserves, and it is not properly tested. To test: - Apply the patch - Run: $ prove t/db_dependent/Members.t => SUCCESS: Tests pass - Sign off Sponsored-by: NEKLS
Created attachment 52930 [details] [review] Bug 16819: C4::Members::DelMember should use Koha::Holds to delete holds This patch makes C4::Members::DelMember proprely use Koha::Holds to delete holds. This is important as holds actions are started to be logged. To reproduce: - Apply the patch - Run: $ prove t/db_dependent/Members.t => SUCCESS: Tests pass - Sign off :-D Sponsored-by: NEKLS
Created attachment 53030 [details] [review] [SIGNED-OFF]Bug 16819: Unit tests for C4::Members::DelMember The C4::Members::DelMember function actually deletes reserves, and it is not properly tested. To test: - Apply the patch - Run: $ prove t/db_dependent/Members.t => SUCCESS: Tests pass - Sign off Sponsored-by: NEKLS Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Created attachment 53031 [details] [review] [SIGNED-OFF]Bug 16819: C4::Members::DelMember should use Koha::Holds to delete holds This patch makes C4::Members::DelMember proprely use Koha::Holds to delete holds. This is important as holds actions are started to be logged. To reproduce: - Apply the patch - Run: $ prove t/db_dependent/Members.t => SUCCESS: Tests pass - Sign off :-D Sponsored-by: NEKLS Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> All tests pass successfully
Comment on attachment 53031 [details] [review] [SIGNED-OFF]Bug 16819: C4::Members::DelMember should use Koha::Holds to delete holds Review of attachment 53031 [details] [review]: ----------------------------------------------------------------- ::: C4/Members.pm @@ +1662,5 @@ > #warn "in delmember with $borrowernumber"; > return unless $borrowernumber; # borrowernumber is mandatory. > + # Delete Patron's holds > + my @holds = Koha::Holds->search({ borrowernumber => $borrowernumber }); > + map { $_->delete } @holds; I'd have written that `$_->delete for @holds`. Since map is supposed to return something I guess it can perturb a new developer. Do you agree?
Created attachment 53054 [details] [review] Bug 16819: Unit tests for C4::Members::DelMember The C4::Members::DelMember function actually deletes reserves, and it is not properly tested. To test: - Apply the patch - Run: $ prove t/db_dependent/Members.t => SUCCESS: Tests pass - Sign off Sponsored-by: NEKLS Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53055 [details] [review] Bug 16819: C4::Members::DelMember should use Koha::Holds to delete holds This patch makes C4::Members::DelMember proprely use Koha::Holds to delete holds. This is important as holds actions are started to be logged. To reproduce: - Apply the patch - Run: $ prove t/db_dependent/Members.t => SUCCESS: Tests pass - Sign off :-D Sponsored-by: NEKLS Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> All tests pass successfully Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 53056 [details] [review] Bug 16819: Remove use of map Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(In reply to Jonathan Druart from comment #8) > Created attachment 53056 [details] [review] [review] > Bug 16819: Remove use of map > > Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Tomas or RM: feel free to obsolete this patch if you want to.
(In reply to Jonathan Druart from comment #9) > (In reply to Jonathan Druart from comment #8) > > Created attachment 53056 [details] [review] [review] [review] > > Bug 16819: Remove use of map > > > > Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> > > Tomas or RM: feel free to obsolete this patch if you want to. I like either, passing the ball to the RM :-D
Pushed to master for 16.11, thanks Tomas, Jonathan!
Pushed in 16.05. Will be in 16.05.02.