Bug 23808: (follow-up) Object methods can be used directly, no need for unblessed
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 20 Mar 2020 12:58:29 +0000 (08:58 -0400)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 20 Mar 2020 15:25:41 +0000 (15:25 +0000)
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

members/memberentry.pl

index 1e8241d..ed482b9 100755 (executable)
@@ -594,13 +594,17 @@ if (C4::Context->preference("IndependentBranches")) {
     }
 }
 if ($op eq 'add'){
-    if ( $guarantor_id ) {
-        my $guarantordata = $guarantor->unblessed;
-        foreach (qw(streetnumber address streettype address2
-          zipcode country city state phone phonepro mobile fax email emailpro branchcode
-          B_streetnumber B_streettype B_address B_address2
-          B_city B_state B_zipcode B_country B_email B_phone)) {
-              $newdata{$_} = $guarantordata->{$_};
+    if ($guarantor_id) {
+        foreach (
+            qw(
+                streetnumber address streettype address2 zipcode country city state phone phonepro mobile
+                fax email emailpro branchcode
+                B_streetnumber B_streettype B_address B_address2
+                B_city B_state B_zipcode B_country B_email B_phone
+            )
+          )
+        {
+            $newdata{$_} = $guarantor->$_;
         }
     }
     $template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1);