[Bug 37742] New: My virtual card message not showing
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Bug ID: 37742 Summary: My virtual card message not showing Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org If the patron barcode can't be converted into Code39, it should show an error message, but right now there's a coding error. It just shows the following: Error: ${errorMessage} -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26777 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26777 [Bug 26777] Give the user the option to display their patron card barcode from the OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|My virtual card message not |My virtual card error |showing |message not showing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- If the translations can use template literals, then you could switch back to a template literal. However, a better idea is to build the HTML using DOM objects. Something like... let para = document.createElement('p'); let strong = document.createElement('strong'); strong.textContent = __("Error:"); let err_msg = document.createTextNode(errorMessage); para.appendChild(strong); para.appendChild(err_msg); document.getElementById('barcode-container').appendChild(para); -- I get that it's a lot longer to write, but it's a billion times safer than using innerHTML. Look at "Cross Site Scripting Prevention Cheat Sheet" by OWASP. Specifically "Safe Sinks". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- I'll probably look at this after an upcoming meeting... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 170744 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170744&action=edit Bug 37742: Fix error display This change fixes the display of the error message on "My virtual card" on the OPAC. Test plan: 0. Apply the patch and enable syspref "OPACVirtualCard" 1. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl ?op=edit_form&destination=circ&borrowernumber=51 2. Add an asterisk (*) to the end of the card number 3. Go to http://localhost:8080/cgi-bin/koha/opac-virtual-card.pl 4. Note that the error message appears as follows: Code 39 must contain only digits, capital letters, spaces and the symbols -.$/+% -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think you are correct about that we should not show a technical error to the user. But it might help debug library staff and I assume they would test this before keeping it active for public? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #4)
I think you are correct about that we should not show a technical error to the user. But it might help debug library staff and I assume they would test this before keeping it active for public?
Perhaps we should have a patron barcode on the staff side too, and then they could troubleshoot it from that side instead? The tough thing with something like this is that there can be a lot of variation in cardnumbers. It might work for a lot of borrowers but not all, and then only a minority are seeing the weirdness. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- OK, so we need to decide here if we want to adapt the error to be generic or not. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Cook from comment #1)
If the translations can use template literals, then you could switch back to a template literal.
What exactly is a template literal? AFAIK our tools can parse HTML in HTML pages, but not HTML that is constructed in JS. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I'd love to get some quick opinion on the message, so we can fix this fast (yes, feeling slightly guilty :) ) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #9 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #6)
OK, so we need to decide here if we want to adapt the error to be generic or not.
Happy to follow your lead here. My opinion is we should show something more user-friendly but that's just my opinion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #10 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #7)
(In reply to David Cook from comment #1)
If the translations can use template literals, then you could switch back to a template literal.
What exactly is a template literal?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_l... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #11 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #8)
I'd love to get some quick opinion on the message, so we can fix this fast (yes, feeling slightly guilty :) )
<3 Instead of using "errorMessage" here I think we could use __("Unavailable to generate barcode"). It should be translatable, and I think anyone with developer support should be able to figure out the problem. If they don't have support, they can come online, and I'll probably end up helping them anyway :p -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to David Cook from comment #10)
(In reply to Katrin Fischer from comment #7)
(In reply to David Cook from comment #1)
If the translations can use template literals, then you could switch back to a template literal.
What exactly is a template literal?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/ Template_literals
I don't think our tools can parse these currently. You'd also not want translators faced with the HTML bits included in these, but only the text.
Instead of using "errorMessage" here I think we could use __("Unavailable to >generate barcode").
I'd maybe make it: Uanble to generate barcode Or: The barcode image could not be generated. Please get in touch with library staff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 --- Comment #13 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #12)
I don't think our tools can parse these currently. You'd also not want translators faced with the HTML bits included in these, but only the text.
It looks like xgettext supports it (bug 24725), and we removed a prohibition against them. But I see your point about not wanting translators faced with the HTML/Javascript bits. Although maybe xgettext deals with that? Unfortunately, I don't know enough about the translatability topic. Scanning through koha-tmpl, it looks like they're just used for non-translateable bits of JS code. Might be worth adding a coding guideline for that I reckon...
Instead of using "errorMessage" here I think we could use __("Unavailable to >generate barcode").
I'd maybe make it:
Uanble to generate barcode
Or:
The barcode image could not be generated. Please get in touch with library staff.
Patch incoming... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170744|0 |1 is obsolete| | --- Comment #14 from David Cook <dcook@prosentient.com.au> --- Created attachment 170850 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170850&action=edit Bug 37742: Fix error display This change fixes the display of the error message on "My virtual card" on the OPAC. Test plan: 0. Apply the patch and enable syspref "OPACVirtualCard" 1. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl ?op=edit_form&destination=circ&borrowernumber=51 2. Add an asterisk (*) to the end of the card number 3. Go to http://localhost:8080/cgi-bin/koha/opac-virtual-card.pl 4. Note that the error message appears as follows: Code 39 must contain only digits, capital letters, spaces and the symbols -.$/+% -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170850|0 |1 is obsolete| | --- Comment #15 from David Nind <david@davidnind.com> --- Created attachment 171159 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171159&action=edit Bug 37742: Fix error display This change fixes the display of the error message on "My virtual card" on the OPAC. Test plan: 0. Apply the patch and enable syspref "OPACVirtualCard" 1. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl ?op=edit_form&destination=circ&borrowernumber=51 2. Add an asterisk (*) to the end of the card number 3. Go to http://localhost:8080/cgi-bin/koha/opac-virtual-card.pl 4. Note that the error message appears as follows: Code 39 must contain only digits, capital letters, spaces and the symbols -.$/+% Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Text to go in the| |This fixes an error message release notes| |shown for a patron's | |virtual card in the OPAC, | |where the patron's card | |number can't be converted | |to a Code39 barcode* | |(OPACVirtualCard system | |preference enabled, Your | |account > My virtual card). | |Previously the error | |message was "Error: | |${errorMessage}", now it is | |"Error: Unable to generate | |barcode". | | | |* Code 39 | |barcodes can only contain | |digits, capital letters, | |spaces, and the symbols | |-.$/+% -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #171159|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> --- Created attachment 173355 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=173355&action=edit Bug 37742: Fix error display This change fixes the display of the error message on "My virtual card" on the OPAC. Test plan: 0. Apply the patch and enable syspref "OPACVirtualCard" 1. Go to http://localhost:8081/cgi-bin/koha/members/memberentry.pl ?op=edit_form&destination=circ&borrowernumber=51 2. Add an asterisk (*) to the end of the card number 3. Go to http://localhost:8080/cgi-bin/koha/opac-virtual-card.pl 4. Note that the error message appears as follows: Code 39 must contain only digits, capital letters, spaces and the symbols -.$/+% Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Martin Renvoize (ashimema) <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com QA Contact|testopia@bugs.koha-communit |martin.renvoize@ptfs-europe |y.org |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|RM_priority | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.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=37742 --- Comment #17 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to main |RESOLVED CC| |lucas@bywatersolutions.com --- Comment #18 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Missing 24.05.x deps, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37742 Bug 37742 depends on bug 26777, which changed state. Bug 26777 Summary: Give the user the option to display their patron card barcode from the OPAC https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26777 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org