[Bug 43437] New: Barcode range printing fails with 500 error when layout contains bibliographic data
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43437 Bug ID: 43437 Summary: Barcode range printing fails with 500 error when layout contains bibliographic data Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Label/patron card printing Assignee: Laura.escamilla@bywatersolutions.com Reporter: Laura.escamilla@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- To reproduce 1. Go to Tools > Label creator > Manage > Layouts. 2. Create or edit a label layout. 3. Set "Choose layout type" to "Bibliographic data precedes barcode" (BIBBAR). 4. Configure the bibliographic data to include a MARC field, for example 245a. 5. Save the layout. 6. Go to Tools > Label creator > New > Barcode range. 7. Enter the barcode of an existing item in both the "From" and "To" fields. 8. Click "Print range." 9. Select a template and the BIBBAR layout created above. 10. Click "Export." 11. Click "Download as PDF." ==> An Error 500 is returned. The logs contain: Can't call method "field" on an undefined value at C4/Labels/Label.pm line 180. The same barcode range can be exported successfully when using a layout which does not require bibliographic data. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43437 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=43437 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43437 --- Comment #1 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Created attachment 204610 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=204610&action=edit Bug 43437: Fix barcode range printing with bibliographic data To test 1. Go to Tools > Label creator > Manage > Layouts. 2. Create or edit a label layout. 3. Set "Choose layout type" to "Bibliographic data precedes barcode" (BIBBAR). 4. Configure the bibliographic data to include a MARC field, for example 245a. 5. Save the layout. 6. Go to Tools > Label creator > New > Barcode range. 7. Enter the barcode of an existing item in both the "From" and "To" fields. 8. Click "Print range." 9. Select a template and the BIBBAR layout created above. 10. Click "Export." 11. Click "Download as PDF." => An Error 500 is returned. The logs contain something similar to: Can't call method "field" on an undefined value at C4/Labels/Label.pm line 180. 12. Apply the patch. 13. Repeat steps 6-11 using the same BIBBAR layout and barcode. => The PDF is generated successfully. => The bibliographic data, including the 245a field, is present. => The barcode is present and correct. 14. Create or select a barcode-only layout. 15. Repeat the barcode range export using the same barcode. => The PDF is generated successfully. => The barcode is present and correct. 16. Test a normal single-item label export using the item's itemnumber rather than the barcode range functionality. => The PDF is generated successfully. => Bibliographic data and barcode output are unchanged. 17. Test a normal saved label batch. => The PDF is generated successfully. => Existing batch label behavior is unchanged. 18. Test a barcode range that includes one or more barcodes which do not exist in the items table. => Existing items in the range are printed. => Missing barcodes do not cause an Error 500. 19. Run the automated label tests: prove t/db_dependent/Labels/t_Label.t => All tests pass. 20. Verify the new tests specifically confirm: - An existing barcode resolves to the correct itemnumber. - A nonexistent barcode does not return an itemnumber. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43437 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |42627 --- Comment #2 from Laura Escamilla <Laura.escamilla@bywatersolutions.com> --- Tested with Bug 42627 applied. Barcode range printing with BIBBAR/bibliographic data continues to work correctly with the new “Starting barcode” and “Number of barcodes to print” workflow. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42627 [Bug 42627] Printing a range of barcodes should be from and quantity instead of from and to -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43437 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Failed QA --- Comment #3 from David Nind <david@davidnind.com> --- I've tested, but have not signed off as I think there are too many issues here. On the plus side, it fixes the problem with the 500 error when the layout contains bibliographic data. However, I've Failed QA because: 1. The instructions in the test plan don't match what is in main (the label printing options have been under Cataloging > Tools for a while now, but I'm not sure for how long). 2. There are JavaScript console errors at various steps (although they exist before the patch) - so maybe another bug is required for these. 3. Batch export: I can only seem to get the barcode to print, even though the layout includes bibliograhic data (my testing steps 10 and 11). 4. Unrelated, and I'll comment on bug 42627, but the change to the "Number of barcodes to print" for the "Print barcode range" is misleading. It is actually only printing any barcodes that exist from the starting barcode entered plus the number entered in the sequence, not the next X barcodes (my testing step 9). Example, if 500 is entered, and the starting barcode is 3999900000001, then it is only going to print the barcodes that exist up until 3999900000500 - not the next 500 barcodes after 3999900000001. Testing notes (using KTD on main): 1. Steps 1 and 2: Cataloging > Tools > Label creator > New > Label layout 2. Step 3: - Layout name: BZ43437 - Select "List fields" (title us already included) - Remove title field and add 245a 3. Step 6: Cataloging > Tools > Label creator > Print barcode range 4. Step 7: Range for barcodes in KTD sample data - From: 3999900000001 - To: 3999900000500 5. On label export page, I get this console error (/cgi-bin/koha/labels/label-print.pl?from=3999900000001&to=3999900000500): Uncaught TypeError: Cannot read properties of null (reading 'parentNode') at label-print.pl?from=3999900000001&to=3999900000500:1049:27 6. Click "Export" 7. I get this console error on the page with the download links (/cgi-bin/koha/labels/label-print.pl): Uncaught TypeError: Cannot read properties of null (reading 'parentNode') at label-print.pl:1011:27 8. When clicking Download, get the "Can't call method "field" on an undefined value at /kohadevbox/koha/C4/Labels/Label.pm line 180" error trace. 9. Step 13: After the patch (and dependent bug): - For the barcode range I selected: . Starting barcode: 3999900000001 . Number of barcodes to print: 500 - Still get the same console errors as above - Only get 7 barcodes printed: 3999900000001 3999900000002 3999900000017 3999900000018 3999900000019 3999900000020 3999900000021 - After this barcode (21) the next in the sequence using item search is 39999000000238 - If I use this setting I get 26 barcodes (39999000000238 to 39999000000737): . Starting barcode: 39999000000238 . Number of barcodes to print: 500 . The PDF includes barcodes 39999000000238 to 39999000000733 ==> So the label "Number of barcodes to print" for the "Print barcode range" is misleading. In this case it is actually only printing any barcodes that exist after the starting barcode + 500 in the sequence (up 39999000000738) 10. Step 16: - If you select a barcode from a batch to export, the "Cancel" button on the label export page does not work - that is clicking "Cancel" does nothing (/cgi-bin/koha/labels/label-print.pl?batch_id=1&1#) - When I choose a label layout that should include the title, and so on, it just prints the barcode. 11. Step 17: Get same results as test plan 16 - only prints barcode and not the bibliographic data. 12. Step 18: No 500 error 13. Tests: these pass 14. Step 20: Not sure if this is asking the tester to check the actual test code and make sure it is correct, or to use the -v option: prove -v t/db_dependent/Labels/t_Label.t t/db_dependent/Labels/t_Label.t .. 1..9 ok 1 - use C4::Labels::Label; ok 2 - Barcode is resolved to the correct itemnumber for label generation ok 3 - Nonexistent barcode does not return an itemnumber ok 4 - Label Text Value defined. ok 5 ok 6 ok 7 ok 8 ok 9 - no warnings ok All tests successful. Files=1, Tests=9, 2 wallclock secs ( 0.02 usr 0.00 sys + 1.76 cusr 0.25 csys = 2.03 CPU) Result: PASS -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43437 --- Comment #4 from David Nind <david@davidnind.com> --- (In reply to David Nind from comment #3)
4. Unrelated, and I'll comment on bug 42627, but the change to the "Number of barcodes to print" for the "Print barcode range" is misleading. It is actually only printing any barcodes that exist from the starting barcode entered plus the number entered in the sequence, not the next X barcodes (my testing step 9). Example, if 500 is entered, and the starting barcode is 3999900000001, then it is only going to print the barcodes that exist up until 3999900000500 - not the next 500 barcodes after 3999900000001.
After I made a comment on bug 42627, it was pointed out to me that it didn't change the behavour as I'd commented. That is, you enter a starting barcode number and the number of barcodes you want, then it generates that number of barcodes in sequence. So it is working as expected - I should have tested that bug by itself! From that I can only conclude that this bug changes the expected behavour - only printing barcodes that exist. So I don't think we should change the expected behavour when printing a barcode range. Also, apologies if I came across a bit grumpy - I wasn't having the best day yesterday, which is really no excuse though. David -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org