[Bug 11290] New: members-home.pl displays badly if using non english templates and have a utf8 char in categorycode description
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Bug ID: 11290 Summary: members-home.pl displays badly if using non english templates and have a utf8 char in categorycode description Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: I18N/L10N Assignee: koha-bugs@lists.koha-community.org Reporter: chris@bigballofwax.co.nz QA Contact: testopia@bugs.koha-community.org CC: frederic@tamil.fr -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=6554 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 --- Comment #1 from Chris Cormack <chris@bigballofwax.co.nz> --- What are the steps to reproduce 1) In a fresh Koha, generate translation into XX 2) Select XX for the staff interface (i.e. enable it, and choose it) 3) Go to the Patrons page 4) Everything looks fine 5) In the admin page, create a patron category with (say) the non-ASCII character 'ñ'. 6) Go back to the Patrons page, everything is broken -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 --- Comment #2 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 23111 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23111&action=edit Bug 11290 : Fixing display problem on members-home.pl To test 1) In a fresh Koha, generate translation into XX 2) Select XX for the staff interface (i.e. enable it, and choose it) 3) Go to the Patrons page 4) Everything looks fine 5) In the admin page, create a patron category with any on-ASCII character. 6) Go back to the Patrons page, everything is broken 7) apply patch 8) regenerate translation 9) go back to the Patrons page, everything looks fine 10) switch to english it still looks fine -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Severity|enhancement |major -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 I'm just a bot <gitbot@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gitbot@bugs.koha-community. | |org When did the bot| |2013-11-23 last check this| | --- Comment #3 from I'm just a bot <gitbot@bugs.koha-community.org> --- Patch applied cleanly, go forth and signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23111|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 23116 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23116&action=edit Bug 11290 : Fixing display problem on members-home.pl To test 1) In a fresh Koha, generate translation into XX 2) Select XX for the staff interface (i.e. enable it, and choose it) 3) Go to the Patrons page 4) Everything looks fine 5) In the admin page, create a patron category with any on-ASCII character. 6) Go back to the Patrons page, everything is broken 7) apply patch 8) regenerate translation 9) go back to the Patrons page, everything looks fine 10) switch to english it still looks fine Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Tried with ru-RU and fixes the problem. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23116|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 23122 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23122&action=edit [PASSED QA] Bug 11290 : Fixing display problem on members-home.pl To test 1) In a fresh Koha, generate translation into XX 2) Select XX for the staff interface (i.e. enable it, and choose it) 3) Go to the Patrons page 4) Everything looks fine 5) In the admin page, create a patron category with any no-ASCII character. 6) Go back to the Patrons page, everything is broken 7) apply patch 8) regenerate translation 9) go back to the Patrons page, everything looks fine 10) switch to english it still looks fine Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Tried with ru-RU and fixes the problem. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script. Problem is also visible on untranslated templates changing one of the sample category descriptions to include diacritics. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 --- Comment #6 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- Just an additional observation: This seems to work for me too. I tested a few combinations including Latin diacritics, and some Chinese characters in the patron category as well as in the members template text. The following remark on Apache::Util did however not fully reassure me: Apache::Util, escape_html says: [This function will correctly escape US-ASCII output. If you are using a different character set such as UTF8, or need more control on the escaping process, use HTML::Entities.] Note that Template Toolkit (at least version 2.87) does however first try Apache::Util and only if that is not available, HTML::Entities. Just under the assumption that HTML::Entities would do a better job, we could do the following, forcing TT to use it: use Template::Filters; Template::Filters->use_html_entities; (That would make HTML::Entities a Koha dependency.) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Jacek Ablewicz <abl@biblos.pk.edu.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |abl@biblos.pk.edu.pl --- Comment #7 from Jacek Ablewicz <abl@biblos.pk.edu.pl> --- Thank you for the patch, it's working for me as well. That said, I wonder if instead of adding more and more html_entity to various templates (there is an similar problem with, e.g., bug 10855, and probably more like that), shouldn't we rather fix C4/Templates.pm? I think the underlying cause for this particular problem in members.pl and members-home.pl is that output()/utf8_arrayref()/utf8_hashref() subs in Templates.pm do not know what to do with objects / blessed hashrefs (they treat them as strings/scalars, actually calling utf8::is_utf8() on them etc.). -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 --- Comment #8 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jacek Ablewicz from comment #7)
That said, I wonder if instead of adding more and more html_entity to various templates (there is an similar problem with, e.g., bug 10855, and probably more like that), shouldn't we rather fix C4/Templates.pm? I think the underlying cause for this particular problem in members.pl and members-home.pl is that output()/utf8_arrayref()/utf8_hashref() subs in Templates.pm do not know what to do with objects / blessed hashrefs (they treat them as strings/scalars, actually calling utf8::is_utf8() on them etc.).
+1 for a generic solution (if available :) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 --- Comment #9 from Jacek Ablewicz <abl@biblos.pk.edu.pl> --- As an experiment I replaced ref() calls in C4/Templates.pm with reftype() from Scalar::Util package; objects/blessed hashrefs are now processed by output(). But it has an unexepected side effect - in every place html_entity filter is being used (we have 3 such places in koha-tmpl/.../intranet/ ) encoding of filtered part now seems to be broken (removing html_entity filter from templates, or replacing it with html filter fixes it). Or perhaps I'm missing something here, and such side efect is acutally being expected (?). BTW, html_entity filter is also used in modules/pay.tt - and encoding of this part ([% line.title |html_entity %] ) indeed seems to be broken (same symptoms in unpatched 3.12.4 version too, not just in master/3.15 with patched or unpatched Templates.pm). Does anyone remeber when and way was is added there? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am also in favor of a generic solution that would help avoid these problems in the future, but I think by pushing this we will get rid of a prominently showing problem quickly. It would give us time to work on the big solution, that will probably require much more time for testing. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=11302 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jacek Ablewicz from comment #7)
I think the underlying cause for this particular problem in members.pl and members-home.pl is that output()/utf8_arrayref()/utf8_hashref() subs in Templates.pm do not know what to do with objects / blessed hashrefs (they treat them as strings/scalars, actually calling utf8::is_utf8() on them etc.).
Preparing for Reno i had tried even removing any call to those sub. I'd be in favour of removing them and using template filters instead (I.e. less loops traversing data structures and less probable double encoding situations).. regards to+ -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 --- Comment #12 from Chris Cormack <chris@bigballofwax.co.nz> --- (In reply to Tomás Cohen Arazi from comment #11)
(In reply to Jacek Ablewicz from comment #7)
I think the underlying cause for this particular problem in members.pl and members-home.pl is that output()/utf8_arrayref()/utf8_hashref() subs in Templates.pm do not know what to do with objects / blessed hashrefs (they treat them as strings/scalars, actually calling utf8::is_utf8() on them etc.).
Preparing for Reno i had tried even removing any call to those sub. I'd be in favour of removing them and using template filters instead (I.e. less loops traversing data structures and less probable double encoding situations)..
I would prefer this situation also -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #13 from Galen Charlton <gmcharlt@gmail.com> --- As a stop-gap, I've pushed this to master. Thanks, Chris! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #14 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.07 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11290 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #15 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 3.12.x will be in 3.12.13 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org