From ed9b8690380315158f9d86846f4e85b9c88bf0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Rodr=C3=ADguez?= Date: Tue, 12 Jul 2022 09:20:45 +0200 Subject: [PATCH] Bug 31137: Only display label printer profiles when editing labels This patch filters the printer profiles in the label edition template so you may only choose Printer Profiles created for Labels. To test 1 Create a new Printer Profile in Patron Cards 2 Edit a Label template, pick the Printer Profile you just created. 3 Save the Label Template. You get an error 500 4 apply patch, restart services 5 Edit a Label template and check that you can't pick the Printer Profile you created in Patron Cards Signed-off-by: Nick Clemens --- labels/label-edit-template.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labels/label-edit-template.pl b/labels/label-edit-template.pl index 9e6a019d09..5f6462b18f 100755 --- a/labels/label-edit-template.pl +++ b/labels/label-edit-template.pl @@ -46,7 +46,7 @@ my $units = get_unit_values(); if ($op eq 'edit') { $label_template = C4::Labels::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, '' ], creator => 'Labels'} } ); push @$profile_list, {paper_bin => 'N/A', profile_id => 0, printer_name => 'No Profile'}; foreach my $profile (@$profile_list) { if ($profile->{'profile_id'} == $label_template->get_attr('profile_id')) { -- 2.30.2