[Bug 23589] New: Discharge notice does not show non-latin characters
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Bug ID: 23589 Summary: Discharge notice does not show non-latin characters Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: theod@lib.auth.gr QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com The discharge notice skips any non latin characters, whether in notice body or in patron details. You can verify this by either: a) modifying the default discharge notice slip and entering a non latin string [ie. "Δοκιμή" (which means testing in Greek)] b) modifying a user firstname/lastname, etc and printing <<borrowers.firstname>> <<borrowers.surname>> in discharge notice slip In current master (Sep. 2019), in both cases, the non-latin strings will be skipped in the pdf output. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Theodoros Theodoropoulos <theod@lib.auth.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=14251 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #1 from Theodoros Theodoropoulos <theod@lib.auth.gr> --- Clarification: b) modifying a user firstname/lastname ADDING NON-LATIN CHARACTERS and printing <<borrowers.firstname>> <<borrowers.surname>> in discharge notice slip -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #2 from Theodoros Theodoropoulos <theod@lib.auth.gr> --- Additional findings: - src/Koha/Patron/Discharge.pm uses PDF::FromHTML->new( encoding => 'utf-8') as it should - temporary html notice IS created AND shows all characters properly, including non-latin ones! It seems that the issue is created during html2pdf conversion and might have to do with the default font used. There is an html2pdf utility (that is based on PDF::FromHTML module) that has the same behavior. This utility allows the user to specify the output font in the pdf. I've experimented with a couple of fonts and there was one case where I managed to see only one line with non-latin characters using a DejaVu font. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dpavlin@rot13.org Assignee|koha-bugs@lists.koha-commun |dpavlin@rot13.org |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #3 from Dobrica Pavlinusic <dpavlin@rot13.org> --- Created attachment 93402 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93402&action=edit Bug 23589: Discharge notice does not show non-latin characters It seems that discarge notices never got support for truetype fonts, so notices are missing non-latin characters. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #4 from Dobrica Pavlinusic <dpavlin@rot13.org> --- I had similar problem and here is a fix. You have to have truetype fonts defined in koha-conf.xml for this to work. If it does, I would appreciate sign-off :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #5 from Theodoros Theodoropoulos <theod@lib.auth.gr> --- Hi Dobrica, Thanks for your patch! Indeed it fixes the output. I will try to properly sign it off later. Having said that, there I'm now at 18.11 and there is another issue (that exists regardless of your patch). The generated pdf file in /tmp/ is proper pdf, the one that gets downloaded when I click discharge is CORRUPTED (has html code appended in the bottom of the pdf file). Did you also have this issue? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |sandboxes@biblibre.com --- Comment #6 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Patch tested with a sandbox, by Theodoros Theodoropoulos <theod@lib.auth.gr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93402|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #7 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Created attachment 93413 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93413&action=edit Bug 23589: Discharge notice does not show non-latin characters It seems that discarge notices never got support for truetype fonts, so notices are missing non-latin characters. Signed-off-by: Theodoros Theodoropoulos <theod@lib.auth.gr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #8 from Theodoros Theodoropoulos <theod@lib.auth.gr> --- Maybe you could also test (and sign off if it works for you) a patch I submitted for BZ23514 here? https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23514 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #9 from Dobrica Pavlinusic <dpavlin@rot13.org> --- (In reply to Theodoros Theodoropoulos from comment #5)
Hi Dobrica,
Thanks for your patch! Indeed it fixes the output. I will try to properly sign it off later.
Having said that, there I'm now at 18.11 and there is another issue (that exists regardless of your patch). The generated pdf file in /tmp/ is proper pdf, the one that gets downloaded when I click discharge is CORRUPTED (has html code appended in the bottom of the pdf file). Did you also have this issue?
You are absolutely right. We indeed emit html (and headers) after pdf. I never noticed this before. This is on 19.05 for me. However, on current master I don't see anything after pdf. I thinks this is difference in configuration and not versions. 19.05 for me (with html junk) is running via plack while my development is plain cgi. Are you also running plack? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #10 from Dobrica Pavlinusic <dpavlin@rot13.org> --- I can confirm that this is plack problem. If I implement something similar to safe_exit in C4::Auth it doesn't emit extra html after pdf. However, this is not the only place where we have exit and while some code flows would exit anyway (since under plack exit doesn't work) I'm sure we have more places in code which should be fixed (ater redirects is one obvious one -- it would seem to work, but we are probably sending Location: header and whole html after it). This will have to be another bug since it will touch many places and isn't really related to this one. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Dobrica Pavlinusic <dpavlin@rot13.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=23723 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #11 from Theodoros Theodoropoulos <theod@lib.auth.gr> --- Indeed, I can verify that I'm using plack too. The new bug sounds a bit (more) critical... Although the fix would be fairly straight forward (replacing exit with safe_exit), identifying where is needed and testing that the patch does the trick might be tricky... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #12 from Theodoros Theodoropoulos <theod@lib.auth.gr> --- Test plan for QA 1/ If using Plack, make sure https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23723 is applied. Otherwise, produced PDF may not be properly encoded. 2/ Go to System Preferences and set useDischarge: Allow 3/ Create (or edit) a patron, entering non-latin characters for example in Surname and/or First Name 4/ In Tools->Notices & slips, make sure you use standard notice settings in DISCHARGE, OR at least make sure you print <<borrowers.firstname>> and/or <<borrowers.surname>> 5/ Goto Patron page -> discharges -> generate discharge 6/ Produced PDF shows no data where <<borrowers.firstname>> and/or <<borrowers.surname>> should have appeared. 7/ apply patch 8/ Goto Patron page -> discharges -> generate discharge 9/ Produced PDF properly shows the data from <<borrowers.firstname>> and/or <<borrowers.surname>> columns -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Theodoros Theodoropoulos from comment #12)
Test plan for QA
1/ If using Plack, make sure https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23723 is applied. Otherwise, produced PDF may not be properly encoded. 2/ Go to System Preferences and set useDischarge: Allow 3/ Create (or edit) a patron, entering non-latin characters for example in Surname and/or First Name 4/ In Tools->Notices & slips, make sure you use standard notice settings in DISCHARGE, OR at least make sure you print <<borrowers.firstname>> and/or <<borrowers.surname>> 5/ Goto Patron page -> discharges -> generate discharge 6/ Produced PDF shows no data where <<borrowers.firstname>> and/or <<borrowers.surname>> should have appeared.
7/ apply patch
8/ Goto Patron page -> discharges -> generate discharge 9/ Produced PDF properly shows the data from <<borrowers.firstname>> and/or <<borrowers.surname>> columns
Perfect, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #93413|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 93595 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=93595&action=edit Bug 23589: Discharge notice does not show non-latin characters It seems that discarge notices never got support for truetype fonts, so notices are missing non-latin characters. Signed-off-by: Theodoros Theodoropoulos <theod@lib.auth.gr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- It's great to see you back Dobrica Pavlinusic, I've missed seeing your name popping up :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |19.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23589 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|19.11.00 |19.11.00,19.05.05 released in| | --- Comment #17 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 19.05.x for 19.05.05 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org