removing warnings from C4::Members::GetMember
authorAndrew Moore <andrew.moore@liblime.com>
Fri, 23 May 2008 18:35:33 +0000 (13:35 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 27 May 2008 11:52:17 +0000 (06:52 -0500)
C4::Members::GetMember emitted a few unnecessary warnings when no $type was passed in. This patch prevents that.

No functional or documentation changes.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Members.pm

index 2eb0664..0fd01f2 100644 (file)
@@ -518,7 +518,7 @@ SELECT borrowers.*, categories.category_type, categories.description
 FROM borrowers 
 LEFT JOIN categories on borrowers.categorycode=categories.categorycode 
 ";
-    if ($type eq 'cardnumber' || $type eq 'firstname'|| $type eq 'userid'|| $type eq 'borrowernumber'){
+    if ( defined $type && ( $type eq 'cardnumber' || $type eq 'firstname'|| $type eq 'userid'|| $type eq 'borrowernumber' ) ){
         $information = uc $information;
         $sth = $dbh->prepare("$select WHERE $type=?");
     } else {