To recreate: 1. Make or edit a label layout. For "Choose layout type:" select " Bibliographic data precedes barcode". 2. Label creator > New > Barcode range 3. Choose a barcode range. 4. Choose the layout from above. 5. 500 error: Can't call method "metadata" on an undefined value at /usr/share/koha/lib/C4/Labels/Label.pm line 342. Seems like this is related to Bug 29697.
I am not sure about this one. I was thinking of barcode range as a feature to pre-produce labels. So you can than add them to the items and scan them in at the same time when cataloguing. I believe as the range allows for you to enter any number and isn't linking to existing items, it probably won't/can't work with labels using bibliographic information. Maybe we need to catch this in a nicer way?
We stumbled on this bug. Yes--we use printing a barcode range to pre-produce labels, to put on an item and then wand in to an item record (e.g., receiving a serial issue, cataloging a book, etc.) But we want our library name on the barcode, so were experimenting with trying to get our library name on the label and discovered this "500 error." Our experimenting is related to bug 31507, "When printing barcode range labels library name does not print." --h2
Hi Heather, thx for commenting, that makes a lot of sense actually. I think this is bug 12316 (that I closed prematurely not thinking of this use case).
And thank you for mentioning that other bug, Katrin--I'll go comment on that one! Cheerio! h2
Same here. Barcode range is mainly used to print them in advance. Strangely, the same barcode range can't have different results. When we stick to just barcodes in the layout, it works like a charm. But if we add free text (e.g. 'City library') in the there, we hit a 500 error.
The layout option 'bibliographic data precedes barcode' appears to rely on itemnumber, which it isn't ideal when printing a barcode range. Before the test Layout - Add a new layout including free text - choose layout type: 'bibliographic data precedes barcode' - Add text between quotation marks in the list fields (e.g. 'Centrale library') - Save Itemnumber check - Find your database max(itemnumber) Barcode check - Find a barcode range 1 that is not currently in your database notes: max(barcode) can be a good start. This range should be smaller < than max(itemnumber) - Find another barcode range 2 that is not currently in your database This second range of numbers should be larger > than max(itemnumber) Test plan 1. In Label creator > Add > Barcode range 2. Enter your barcode range 1; the one smaller < max(itemnumber) 3. Click on "Print range" 4. Choose the layout from above 5. Click on "Export" 6. View the pdf --> ok, Koha is printing text on each label 7. Redo steps 2 to 3 with the barcode range 2; the one larger > max(itemnumber) 8. Select the DEFAULT layout 9. Check the pdf --> Koha generate all barcodes correctly 10. Keep your barcode range 2 and redo steps 2 to 3, but... 11. Select the layout with text previously added 12. Check the pdf --> Koha open up a 500 error page or empty page
Created attachment 162282 [details] [review] Bug 34157: Exporting labels as a barcode range can cause 500 error The layout option 'bibliographic data precedes barcode' appears to rely on itemnumber, which it isn't ideal when printing a barcode range. Before the test Layout - Add a new layout including free text - choose layout type: 'bibliographic data precedes barcode' - Add text between quotation marks in the list fields (e.g. 'Centrale library') - Save Itemnumber check - Find your database max(itemnumber) Barcode check - Find a barcode range 1 that is not currently in your database notes: max(barcode) can be a good start. This range should be smaller < than max(itemnumber) - Find another barcode range 2 that is not currently in your database This second range of numbers should be larger > than max(itemnumber) Test plan 1. In Label creator > Add > Barcode range 2. Enter your barcode range 1; the one smaller < max(itemnumber) 3. Click on "Print range" 4. Choose the layout from above 5. Click on "Export" 6. View the pdf --> ok, Koha is printing text on each label 7. Redo steps 2 to 3 with the barcode range 2; the one larger > max(itemnumber) 8. Select the DEFAULT layout 9. Check the pdf --> Koha generate all barcodes correctly 10. Keep your barcode range 2 and redo steps 2 to 3, but... 11. Select the layout with text previously added 12. Check the pdf --> Koha open up a 500 error page or empty page 13. apply the patch 14. Perform the same steps as before, but this time without encountering any errors. Koha is printing text on each label during step 12.
Created attachment 167338 [details] [review] Bug 34157: Exporting labels as a barcode range can cause 500 error Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com> Seems to contain some leftover debug code: `print STDERR "label_a: iffffffff";` in `label-create-pdf.pl`
Looks like the patch has some debugging data in it? print STDERR "label_a: iffffffff";
Created attachment 172577 [details] [review] Bug 34157: (Follow up) Removed the debugging data