Bugzilla – Attachment 183898 Details for
Bug 34157
Exporting labels as a barcode range can cause a 500 error
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34157: Exporting labels as a barcode range can cause 500 error
Bug-34157-Exporting-labels-as-a-barcode-range-can-.patch (text/plain), 3.45 KB, created by
Marcel de Rooy
on 2025-07-09 14:47:04 UTC
(
hide
)
Description:
Bug 34157: Exporting labels as a barcode range can cause 500 error
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-07-09 14:47:04 UTC
Size:
3.45 KB
patch
obsolete
>From 6818515d06c65448a81d80abfd047dbda8d4e01d Mon Sep 17 00:00:00 2001 >From: Matthias Le Gac <matthias.le-gac@inlibro.com> >Date: Fri, 16 Feb 2024 10:43:18 -0500 >Subject: [PATCH] Bug 34157: Exporting labels as a barcode range can cause 500 > error >MIME-Version: 1.0 >Content-Type: text/plain; charset=utf-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset=utf-8 > >This fixes the error 500 generated when using the label >generator if you use the "Bibliographic data precedes >barcode" layout type when printing a barcode range. > >Test plan: >1. Set up information for testing: > 1.1 Create a new label layout: > 1.1.1 Cataloging > Tools > Label creator > 1.1.2 New > Label layout > 1.1.3 Add these details: > - Layout name: BZ34157 > - Choose layout type: Bibliographic data precedes barcode > - Select 'List fieds' > - Data fields: add some text at the end > title, author, isbn, issn, itemtype, barcode, > itemcallnumber, 'Some text' > 1.1.3 Save > 1.2 Ranges of barcode numbers for testing: > 1.2.1 Where the numbers are not used in KTD, and are LOWER than > the highest barcode number (39999000019193): > 500000 to 500100 > 1.2.3 Where the numbers are not used in KTD, and are HIGHER than > the highest barcode number (39999000019193): > 39999000020000 to 39999000020100 > 1.2.2 Where the numbers are used in KTD: > 3999900000001 to 3999900001001 >2. Print a barcode range using the ranges in 1.2: > 2.1 Cataloging > Tools > Label creator > Print barcode range > 2.2 Enter the barcode ranges > 2.3 Select a layout to be applied: BZ34157 > 2.4 Export > 2.5 Click "Download as PDF" > 2.6 Results for all barcode ranges: > ==> You get a page with "An error has occured! Error 500...". >3. Repeat step 2, but select the DEFAULT layout for 2.3: > ==> Results for all barcode ranges: PDFs with barcode labels > successfully generated >4. Apply the patches and restart everything (restart_all) >5. Repeat steps 2 and 3. >6. Results for all barcode ranges and the BZ34157 and DEFAULT layouts: > ==> PDFs with barcode labels successfully generated > >Signed-off-by: Tadeusz âtadzikâ SoÅnierz <tadeusz@sosnierz.com> >Signed-off-by: David Nind <david@davidnind.com> > >Bug 34157: (Follow up) Removed the debugging data > >Signed-off-by: David Nind <david@davidnind.com> > >Bug 34157: (follow-up) Tidiness fix > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >[EDIT] Squashed >--- > C4/Labels/Label.pm | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > >diff --git a/C4/Labels/Label.pm b/C4/Labels/Label.pm >index 842cfb051a..dd289083ee 100644 >--- a/C4/Labels/Label.pm >+++ b/C4/Labels/Label.pm >@@ -385,8 +385,12 @@ sub draw_label_text { > my $font = $self->{'font'}; > my $item = _get_label_item( $self->{'item_number'} ); > my $label_fields = _get_text_fields( $self->{'format_string'} ); >- my $biblio = Koha::Biblios->find( $item->{biblionumber} ); >- my $record = $biblio->metadata->record; >+ my $biblio = Koha::Biblios->find( $item->{'biblionumber'} ); >+ my $record; >+ >+ if ( defined $biblio ) { >+ $record = $biblio->metadata->record; >+ } > > # FIXME - returns all items, so you can't get data from an embedded holdings field. > # TODO - add a GetMarcBiblio1item(bibnum,itemnum) or a GetMarcItem(itemnum). >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34157
:
162282
|
167338
|
172577
|
179001
|
179002
|
183772
|
183800
|
183801
|
183802
| 183898