LP#1659928: fix regression introduce by previous patches
authorGalen Charlton <gmc@equinoxinitiative.org>
Fri, 11 Aug 2017 16:23:01 +0000 (12:23 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 11 Aug 2017 16:23:01 +0000 (12:23 -0400)
A couple other places that use the standing_penalty list needed to
be adjusted to account for the non-de-fleshing.

Kudos to Jason Etheridge for noting the live_t test failure. Also,
unit tests FTW.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm

index cf6375a..9e593e5 100644 (file)
@@ -469,7 +469,7 @@ sub too_many_charged {      # not implemented
 sub too_many_overdue { 
     my $self = shift;
     return scalar( # PATRON_EXCEEDS_OVERDUE_COUNT
-        grep { $_ == OILS_PENALTY_PATRON_EXCEEDS_OVERDUE_COUNT } @{$self->{user}->standing_penalties}
+        grep { $_->id == OILS_PENALTY_PATRON_EXCEEDS_OVERDUE_COUNT } @{$self->{user}->standing_penalties}
     );
 }
 
@@ -494,7 +494,7 @@ sub too_many_lost {
 sub excessive_fines { 
     my $self = shift;
     return scalar( # PATRON_EXCEEDS_FINES
-        grep { $_ == OILS_PENALTY_PATRON_EXCEEDS_FINES } @{$self->{user}->standing_penalties}
+        grep { $_->id == OILS_PENALTY_PATRON_EXCEEDS_FINES } @{$self->{user}->standing_penalties}
     );
 }