From f5864321f06fa7ca34ce9c5c7a0956596a3ac31c 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 --- 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 3712a6fd82..dcf817a095 100755 --- a/patroncards/edit-template.pl +++ b/patroncards/edit-template.pl @@ -49,10 +49,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.25.1