Bug 31220 - Error when attempting to export selected labels as PDF
Summary: Error when attempting to export selected labels as PDF
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords:
: 29994 (view as bug list)
Depends on: 26340
Blocks: 31564
  Show dependency treegraph
 
Reported: 2022-07-22 11:36 UTC by Nick Clemens (kidclamp)
Modified: 2023-06-08 22:26 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.04, 21.11.11
Circulation function:


Attachments
BUg 31220: Pass label batch and ids to label-create-pdf (2.95 KB, patch)
2022-07-22 11:44 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
BUg 31220: Pass label batch and ids to label-create-pdf (3.02 KB, patch)
2022-07-22 11:56 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 31220: (follow-up) Remove debug statements (930 bytes, patch)
2022-08-01 15:55 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 31220: Pass label batch and ids to label-create-pdf (2.39 KB, patch)
2022-08-02 18:06 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 31220: (QA follow-up) Add missing filter (1.84 KB, patch)
2022-08-02 18:06 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2022-07-22 11:36:03 UTC
To recreate:
1 - Create a new label batch with some items
2 - Select 1 or more
3 - Export selected labels
4 - Download as PDF
5 - BOOM

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.


It looks like bug 26340 accidentally touched the selected label export and removed batch number and label ids
Comment 1 Nick Clemens (kidclamp) 2022-07-22 11:44:17 UTC
Created attachment 138009 [details] [review]
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!
Comment 2 ByWater Sandboxes 2022-07-22 11:56:37 UTC
Created attachment 138012 [details] [review]
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 <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Sally 2022-07-22 11:57:41 UTC
Nice fix - works as described, so signing off. Thanks for the patch.
Comment 4 Victor Grousset/tuxayo 2022-07-27 22:40:15 UTC
Are the warn Data::Dumper::Dumper forgotten there or are there logging improvements?
Comment 5 Nick Clemens (kidclamp) 2022-08-01 15:55:28 UTC
Created attachment 138479 [details] [review]
Bug 31220: (follow-up) Remove debug statements
Comment 6 Lucas Gass (lukeg) 2022-08-02 17:45:49 UTC
*** Bug 29994 has been marked as a duplicate of this bug. ***
Comment 7 Tomás Cohen Arazi (tcohen) 2022-08-02 18:06:34 UTC
Created attachment 138516 [details] [review]
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 <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 8 Tomás Cohen Arazi (tcohen) 2022-08-02 18:06:40 UTC
Created attachment 138517 [details] [review]
Bug 31220: (QA follow-up) Add missing filter

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 9 Tomás Cohen Arazi (tcohen) 2022-08-03 14:50:26 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 10 Aleisha Amohia 2022-08-14 23:01:13 UTC
Hey team, this bug is valid in Koha 21.11.x, can it please be backported?
Comment 11 Lucas Gass (lukeg) 2022-08-19 19:17:25 UTC
Backported to 22.05.x for 22.05.04
Comment 12 Arthur Suzuki 2022-08-21 08:46:55 UTC
pushed to 21.11.x for 21.11.11
Comment 13 Victor Grousset/tuxayo 2022-08-23 00:00:07 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.