Bug 15653 - Updating a guarantor has never updated its guarantees
Summary: Updating a guarantor has never updated its guarantees
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 15548
Blocks: 15656
  Show dependency treegraph
 
Reported: 2016-01-25 12:39 UTC by Jonathan Druart
Modified: 2017-06-14 22:08 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15653: Remove unused C4::Members::UpdateGuarantees subroutine (3.72 KB, patch)
2016-01-25 12:48 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF]Bug 15653: Remove unused C4::Members::UpdateGuarantees subroutine (3.79 KB, patch)
2016-01-25 15:23 UTC, Héctor Eduardo Castro Avalos
Details | Diff | Splinter Review
Bug 15653: Remove unused C4::Members::UpdateGuarantees subroutine (3.77 KB, patch)
2016-03-04 10:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15653: Remove unused C4::Members::UpdateGuarantees subroutine (3.83 KB, patch)
2016-03-11 17:56 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2016-01-25 12:39:18 UTC

    
Comment 1 Jonathan Druart 2016-01-25 12:48:42 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-01-25 15:23:04 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-03-04 10:07:57 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2016-03-11 17:56:40 UTC
Created attachment 49051 [details] [review]
Bug 15653: Remove unused C4::Members::UpdateGuarantees subroutine

Looking at the code, there is some broken with the guarantees code.
It seems that the expected behavior would be to update address, fax,
B_city, mobile, city and phone info of the guarantees when a guarantor
is modified.
But the code in C4::Members::ModMember is broken:

 668         my $borrowercategory= GetBorrowercategory(
$data{'category_type'} );
 669         if ( exists  $borrowercategory->{'category_type'} &&
$borrowercategory->{'category_type'} eq ('A' || 'S') ) {
 670             # is adult check guarantees;
 671             UpdateGuarantees(%data);
 672         }

First, GetBorrowerCategory expects a categorycode, not a category_type.
Then UpdateGuarantees retrieves the param like:

 989 sub UpdateGuarantees {
 990     my %data = shift;

Which means that %data will always be something like ( a_key => undef )
And nothing more.

The updateguarantees subroutine (It has been renamed) has been introduced by

commit 56825e415fc232e38f0a874dc9a81fa2169ef06b
Date:   Mon Aug 30 13:48:58 2004 +0000
    modularizing (with Members.pm) members management
    (beginning of...)

And the `%data = shift` already existed...

This code has never worked and could be removed.

See http://lists.koha-community.org/pipermail/koha-devel/2016-January/042241.html

Test plan:
Confirm the previous assertions.

Note that I have found this bug working on bug 15631, see patch "Bug
15631: Koha::Cities - remove getidcity and GetCities"

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 5 Brendan Gallagher 2016-03-12 23:39:46 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!