[Bug 29994] New: Single label pdf export not working
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Bug ID: 29994 Summary: Single label pdf export not working Change sponsored?: --- Product: Koha Version: 21.11 Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Label/patron card printing Assignee: cnighswonger@foundations.edu Reporter: isabel.pineda@ds.edu.sv QA Contact: testopia@bugs.koha-community.org Since update from 21.05 to 21.11 the export of single labels to pdf is not working anymore. If there are at least 2 labels in a label batch, it works, but single labels cannot be exported to pdf. I have just updated from 21.11.01 to 21.11.02, but in the new version this has not been fixed yet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It appears to be working on master. Isabel, could you add some more information about your setup for the labels? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #2 from Isabel Pineda <isabel.pineda@ds.edu.sv> --- Hi Katrin. Of course. The template is set this way: page height: 2.5 cm page width: 5 cm label width: 5.8 cm label height: 4 cm top page margin: -0.6 cm left page margin: 0 cm top text margin: 1.3 cm left text margin: 0 cm number of columns: 1 number of rows: 1 gap between columns: 0 cm gap between rows: 0 cm The label layout: barcode type: Code 39 layout type: BIBBAR Data fields: itemcallnumber Text justification: left Font: Helvetica Font size: 12 Oblique title: yes The problem is that an empty pdf file is generated when I there is only a single label. If it is a batch with at least 2 labels, it works fine. It used to work for me with single labels and the same settings before version 21.11. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com --- Comment #3 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- The problem occurs when clicking the "Export" button in the table of items, Actions column. To test: 1) If you do not already have label templates and layouts, add some (can use the settings in comment 2, but any will do) 2) Go to Tools > Label creator > New > Label batch 3) Add one barcode in the box 4) Click Add items 5) Click the 'Export full batch' button 6) Choose the label template and layout 7) Click Export 8) Click Download as PDF --> PDF is generated 9) In the label batch, select the item (the checkbox on the right) 10) Click 'Export selected items' 11) Repeat steps 6-8 --> PDF is generated 12) In the label batch, click the 'Export' button in the Actions column 13) Repeat steps 6-8 --> No PDF is generated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Manos PETRIDIS <egpetridis@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |egpetridis@yahoo.com --- Comment #4 from Manos PETRIDIS <egpetridis@yahoo.com> --- Could this be related to https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28806 ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #5 from Isabel Pineda <isabel.pineda@ds.edu.sv> --- (In reply to Caroline Cyr La Rose from comment #3)
The problem occurs when clicking the "Export" button in the table of items, Actions column.
To test: 1) If you do not already have label templates and layouts, add some (can use the settings in comment 2, but any will do) 2) Go to Tools > Label creator > New > Label batch 3) Add one barcode in the box 4) Click Add items 5) Click the 'Export full batch' button 6) Choose the label template and layout 7) Click Export 8) Click Download as PDF --> PDF is generated 9) In the label batch, select the item (the checkbox on the right) 10) Click 'Export selected items' 11) Repeat steps 6-8 --> PDF is generated 12) In the label batch, click the 'Export' button in the Actions column 13) Repeat steps 6-8 --> No PDF is generated
Thank you. Yes, this way it works, at least it does now that I upgraded to version 22.05. I remember that the single export button in the table used to work in Koha 21.05 and previous versions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #6 from Isabel Pineda <isabel.pineda@ds.edu.sv> --- (In reply to Manos PETRIDIS from comment #4)
Could this be related to https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28806 ?
Thank you. No, in my case all printed characters are Latin characters. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #7 from Isabel Pineda <isabel.pineda@ds.edu.sv> --- (In reply to Isabel Pineda from comment #6)
(In reply to Manos PETRIDIS from comment #4)
Could this be related to https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28806 ?
Thank you. No, in my case all printed characters are Latin characters.
We are using Koha in Spanish, though. Maybe this has something to do with the problem. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Single label pdf export not |Single label PDF export not |working |working -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|21.11 |unspecified CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #8 from Lucas Gass <lucas@bywatersolutions.com> --- I am able to recreate this in current master. 1. Make a label batch. 2. Go to 'label-edit-batch.pl' and select at least one item in the table. ( #batcht ) 3. Use the 'Export' button to export at one item. 4. Choose template/layout etc. 5. Download as PDF This is the error I see: Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /kohadevbox/koha/labels/label-create-pdf.pl line 127 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #9 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Lucas Gass from comment #8)
This is the error I see: Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /kohadevbox/koha/labels/label-create-pdf.pl line 127
See the comment here: https://github.com/Koha-Community/Koha/blob/master/C4/Creators/Batch.pm#L156 What is being passed in as the batch id? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #10 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Chris Nighswonger from comment #9)
(In reply to Lucas Gass from comment #8)
This is the error I see: Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /kohadevbox/koha/labels/label-create-pdf.pl line 127
See the comment here:
https://github.com/Koha-Community/Koha/blob/master/C4/Creators/Batch.pm#L156
What is being passed in as the batch id?
At a minimum this error should be trapped here: https://github.com/Koha-Community/Koha/blob/master/labels/label-create-pdf.p... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #11 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Chris Nighswonger from comment #9)
(In reply to Lucas Gass from comment #8)
This is the error I see: Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /kohadevbox/koha/labels/label-create-pdf.pl line 127
See the comment here:
https://github.com/Koha-Community/Koha/blob/master/C4/Creators/Batch.pm#L156
What is being passed in as the batch id?
The URL to create the PDF should similar to this: https://jl-staff.campus.foundations.edu/cgi-bin/koha/labels/label-create-pdf.pl?batch_id=858&template_id=1&layout_id=5&start_label=1&label_id=25498 If batch_id is non-existent or an invalid value, C4::Creators::Batch->retrieve will return -2. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #12 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Lucas Gass from comment #8)
I am able to recreate this in current master.
1. Make a label batch. 2. Go to 'label-edit-batch.pl' and select at least one item in the table. ( #batcht )
batch_id originates from element_id passed in to label-edit-batch.pl. ie. https://jl-staff.campus.foundations.edu/cgi-bin/koha/labels/label-edit-batch.pl?op=edit&element_id=858
3. Use the 'Export' button to export at one item. 4. Choose template/layout etc.
The fact that you are able to get this far would seem to indicate that a valid batch_id is being passed in to this point.
5. Download as PDF
This is the error I see: Can't locate object method "get_attr" via package "-2" (perhaps you forgot to load "-2"?) at /kohadevbox/koha/labels/label-create-pdf.pl line 127
It appears that by the time you get to this point, the batch_id has become corrupted somehow. Please post both the label-edit-batch.pl URL and the label-create-pdf-pl URL for your failure case. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31241 CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28806 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #13 from Chris Nighswonger <cnighswonger@foundations.edu> --- If one of the folks experiencing this issue could post both the label-edit-batch.pl URL and the label-create-pdf.pl URL for your failure case, please. Also, please post the output from the following query limited by the batch_id of your failure case: SELECT * FROM creator_batches WHERE batch_id=<your-batch_id-here>; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |critical -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #14 from Chris Nighswonger <cnighswonger@foundations.edu> --- (In reply to Caroline Cyr La Rose from comment #3)
The problem occurs when clicking the "Export" button in the table of items,
This is important. There are two separate JS functions which are attached to these export "options." The Export button triggers one[1] while the 'Export selected items' triggers another[2]. In the former, batch_id is passed in via a TT variable; in the latter it is extracted from the data value of the element. I wonder if the latter is munged up somehow... If so, this could explain the discrepancy I mentioned in comment #12. So what we need to see is the resulting URL generated by each of these functions. Perhaps someone with the issue can grab these from the network tab in the browser debug console and post them here? [1] https://github.com/Koha-Community/Koha/blob/cdf34ce15603edfee5453ce7b232d2ce... [2] https://github.com/Koha-Community/Koha/blob/cdf34ce15603edfee5453ce7b232d2ce... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P3 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Chris Nighswonger <cnighswonger@foundations.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #15 from Chris Nighswonger <cnighswonger@foundations.edu> --- Former and latter should be swapped in comment #14... where's the edit comment options when you need it? ;-P -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |DUPLICATE --- Comment #16 from Lucas Gass <lucas@bywatersolutions.com> --- *** This bug has been marked as a duplicate of bug 31220 *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=29994 --- Comment #17 from Chris Nighswonger <cnighswonger@foundations.edu> --- Good catch. Thanks! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org