From bea4eabc9463fde0b385ea6de20e31e84bbeb322 Mon Sep 17 00:00:00 2001
From: Rinrada Wongsaichua <hlunlin93@gmail.com>
Date: Tue, 18 Feb 2020 11:00:50 +0100
Subject: [PATCH] Bug 24001: Fix patron card template edition

Error when saving Patron card Template:
Can't bless non-reference value at
/home/vagrant/kohaclone/C4/Creators/Profile.pm line 89

Can be fixed by add this one line into
/usr/share/koha/intranet/cgi-bin/patroncards/edit-template.pl
---
 patroncards/edit-template.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/patroncards/edit-template.pl b/patroncards/edit-template.pl
index a3235d22f6..a67e7baa62 100755
--- a/patroncards/edit-template.pl
+++ b/patroncards/edit-template.pl
@@ -50,6 +50,7 @@ my $units = get_unit_values();
 if ($op eq 'edit') {
     $card_template = C4::Patroncards::Template->retrieve(template_id => $template_id);
     $profile_list = get_all_profiles({ fields => [ qw( profile_id printer_name paper_bin ) ], filters => {template_id => [ $template_id, '' ]} } );
+    push @$profile_list, {paper_bin => 'N/A', profile_id => 0, printer_name => 'No Profile'};
 }
 elsif ($op eq 'save') {
     my @params = (      profile_id      => scalar $cgi->param('profile_id') || '0',
-- 
2.11.0