https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28806

--- Comment #32 from Chris Nighswonger 
<[email protected]> ---
Some empirical results from re-testing this on current main in
koha-testing-docker, exercising the same code path label-create-pdf.pl uses
(Compress -> Mbox -> create_label -> per-line Font/FontSize/Text -> End):

1) Greek data renders fine on current main: a BIBBAR label with a Greek 245\$a
produces a ~22KB PDF with the configured TTF embedded, on both PDF::Reuse 0.39
and 0.43. So neither the non-latin data nor the PDF::Reuse version explains
this by itself.

2) Comment 31 reproduces, with a concrete mechanism. _get_label_item()
(C4/Labels/Label.pm:91) selects with an INNER join on
i.homebranch=br.branchcode. An item whose homebranch is NULL returns no row at
all, so every bib field downstream is empty and the text lines are silently
skipped -- my test BIBBAR export collapsed to exactly the barcode-only output,
with no warning anywhere. The same applies to any item that fails the other
join conditions (orphaned biblioitem links etc.) -- i.e. precisely the
"corrupted underlying data" theory from comment 12, now with a mechanism.

3) The zero-byte part has a structural amplifier: label-create-pdf.pl prints
the CGI attachment header (line 55) before any PDF work. Anything that dies
between the header and \$pdf->End() streams a zero-byte download to the browser
while the actual error lands only in the plack log. On current main my
NULL-homebranch test degrades silently rather than dying, but on older versions
(this report spans 21.11-22.11) the same missing-row data hitting
version-specific code (e.g. Koha::Biblios->find(undef) behavior) could die and
produce exactly the 0-byte file reported here.

Suggested path: change the join in _get_label_item() to a LEFT JOIN on branches
(with a warn when bib data is missing), which would make labels for such items
render instead of silently losing text. I can work up a patch along those lines
once my current in-flight label/patroncard bugs clear the queue, if that seems
sensible.

(Tested with AI assistance in koha-testing-docker.)

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to