Bug 17181: Simplify code
[koha.git] / patroncards / edit-profile.pl
index 55e903c..b7e61bd 100755 (executable)
@@ -88,7 +88,10 @@ foreach my $unit (@$units) {
     }
 }
 
-$template->param(profile_id => $profile->get_attr('profile_id')) if $profile->get_attr('profile_id') > 0;
+# if new layout, there will be no profile id, so shouldn't look for it
+if ( $profile_id && $profile->get_attr('profile_id') > 0 ) {
+    $template->param( profile_id => $profile->get_attr('profile_id') );
+}
 
 $template->param(
     label_template      => $label_template[0]->{'template_code'} || '',