Bugzilla – Attachment 171159 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.17 KB, created by
David Nind
on 2024-09-06 22:57:16 UTC
(
hide
)
Description:
Bug 37742: Fix error display
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-09-06 22:57:16 UTC
Size:
2.17 KB
patch
obsolete
>From 5a558ec42ed1043f8df117386f323d4b85aad6b0 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> >--- > .../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 97628ba7fa..753edb6e73 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.39.2
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