From fe23d527237bcc3c4871399b5f030d5d97ab42bd Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 22 Jul 2022 11:36:06 +0000 Subject: [PATCH] BUg 31220: Pass label batch and ids to label-create-pdf This patch fixes a malformed link to print selected labels and fix error: Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /usr/share/koha/intranet/cgi-bin/labels/label-create-pdf.pl line 126. To test: 1 - Create a new label batch with some items 2 - Select 1 or more 3 - Export selected labels 4 - Download as PDF 5 - It works! Signed-off-by: Sally --- koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt | 2 +- labels/label-create-pdf.pl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt index 7349d8fb06..2732fe8a12 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt @@ -22,7 +22,7 @@
[% IF ( batche.label_ids ) %] [% IF ( batche.label_count == 1 ) %][% batche.label_count | html %] single label[% ELSE %][% batche.label_count | html %] single labels[% END %] - Download as PDF + Download as PDF

Download as CSV

diff --git a/labels/label-create-pdf.pl b/labels/label-create-pdf.pl index f1cd47183c..46a5da13b7 100755 --- a/labels/label-create-pdf.pl +++ b/labels/label-create-pdf.pl @@ -56,7 +56,9 @@ print $cgi->header( -type => 'application/pdf', ); our $pdf = C4::Creators::PDF->new(InitVars => 0); +warn Data::Dumper::Dumper( $batch_id ); my $batch = C4::Labels::Batch->retrieve(batch_id => $batch_id); +warn Data::Dumper::Dumper( $batch ); our $template = C4::Labels::Template->retrieve(template_id => $template_id, profile_id => 1); my $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id); -- 2.30.2