Bugzilla – Attachment 173355 Details for
Bug 37742
My virtual card error message not showing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37742: Fix error display
Bug-37742-Fix-error-display.patch (text/plain), 2.23 KB, created by
Martin Renvoize (ashimema)
on 2024-10-25 12:35:49 UTC
(
hide
)
Description:
Bug 37742: Fix error display
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-25 12:35:49 UTC
Size:
2.23 KB
patch
obsolete
>From 0590122a97597c75299fb0458be9e0a1fa902800 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 27 Aug 2024 03:50:44 +0000 >Subject: [PATCH] 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> >--- > .../opac-tmpl/bootstrap/js/barcode-generator.js | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js b/koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js >index 97628ba7fae..753edb6e731 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/barcode-generator.js >@@ -17,11 +17,16 @@ document.addEventListener("DOMContentLoaded", function() { > } > document.getElementById('barcode-container').innerHTML = svg > } catch (error) { >- // Use regex to find error message >- const match = error.message.match(/: (.+)$/); >- const errorMessage = match ? match[1] : error.message; >- > console.error(error); >- document.getElementById('barcode-container').innerHTML = "<p><strong>" + __("Error:") + " </strong>${errorMessage}</p>"; >+ >+ const p_node = document.createElement('p'); >+ const strong_node = document.createElement('strong'); >+ strong_node.textContent = __("Error: "); >+ const span_node = document.createElement('span'); >+ span_node.textContent = __("Unable to generate barcode"); >+ span_node.setAttribute('id','barcode-gen-error'); >+ p_node.appendChild(strong_node); >+ p_node.appendChild(span_node); >+ document.getElementById('barcode-container').replaceChildren(p_node); > } > }); >-- >2.47.0
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 37742
:
170744
|
170850
|
171159
| 173355