Bug 31220

Summary: Error when attempting to export selected labels as PDF
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: ToolsAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: aleisha, andrewfh, arthur.suzuki, cnighswonger, daniel.gaghan, dcook, isabel.pineda, lucas, sally.healey, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
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
Bug Depends on: 26340    
Bug Blocks: 31564    
Attachments: BUg 31220: Pass label batch and ids to label-create-pdf
BUg 31220: Pass label batch and ids to label-create-pdf
Bug 31220: (follow-up) Remove debug statements
Bug 31220: Pass label batch and ids to label-create-pdf
Bug 31220: (QA follow-up) Add missing filter

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 2022-08-02 17:45:49 UTC
*** Bug 29994 has been marked as a duplicate of this bug. ***
Comment 7 Tomás Cohen Arazi 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 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 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 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.