From 8be82f861621cdf86bcd4b683254365542897ed4 Mon Sep 17 00:00:00 2001 From: Blou Date: Tue, 30 Jun 2020 12:50:09 -0400 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 This is caused by the profile dropdown offering invalid choices and is fixed by adding a filter to limit options to creator = 'Patroncards'. The UI already handles the case where no valid profile is avaiable. Signed-off-by: Alexis Ripetti Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- patroncards/edit-template.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patroncards/edit-template.pl b/patroncards/edit-template.pl index 0238701162..1c7a2cd411 100755 --- a/patroncards/edit-template.pl +++ b/patroncards/edit-template.pl @@ -47,10 +47,10 @@ 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, '' ]} } ); + $profile_list = get_all_profiles({ fields => [ qw( profile_id printer_name paper_bin ) ], filters => {template_id => [ $template_id, 0 ], creator => 'Patroncards'} } ); } elsif ($op eq 'save') { - my @params = ( profile_id => scalar $cgi->param('profile_id') || '', + my @params = ( profile_id => scalar $cgi->param('profile_id') || 0, template_code => scalar $cgi->param('template_code'), template_desc => scalar $cgi->param('template_desc'), page_width => scalar $cgi->param('page_width'), -- 2.39.5