Bug 11630: (follow-up) tighten up code
authorGalen Charlton <gmc@esilibrary.com>
Wed, 16 Apr 2014 15:28:38 +0000 (15:28 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Wed, 16 Apr 2014 15:32:29 +0000 (15:32 +0000)
This patch tightens up the initialization of the $restriction_age
variable and uses $bibvalues throughout.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/Circulation.pm

index 91a5814..f4fe578 100644 (file)
@@ -977,9 +977,7 @@ sub CanBookBeIssued {
     # get $marker from preferences. Could be something like "FSK|PEGI|Alter|Age:"
     my $markers         = C4::Context->preference('AgeRestrictionMarker');
     my $bibvalues       = $biblioitem->{'agerestriction'};
-    my $restriction_age = 0;
-
-    $restriction_age = GetAgeRestriction( $biblioitem->{'agerestriction'} );
+    my $restriction_age = GetAgeRestriction( $bibvalues );
 
     if ( $restriction_age > 0 ) {
         if ( $borrower->{'dateofbirth'} ) {