From 0eb3a73c2fba4f609c0dab015a843a550e03516e Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Thu, 2 Jun 2016 17:52:02 -0400 Subject: [PATCH] LP#1528647 Self-check only accepts user name value if regex for barcode not set up This patch was written by Bob Wicksall and posted to launchpad. I've tested on my own server and packaged it for review here. The fix allows a patron to log into the self-check interface with either a barcode or a user name. Signed-off-by: Terran McCanna --- Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js index edce285d48..8c633e1644 100644 --- a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js +++ b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js @@ -333,8 +333,12 @@ SelfCheckManager.prototype.loadOrgSettings = function() { this.orgSettings[k] = settings[k].value; } - if(settings[SET_BARCODE_REGEX]) - this.patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value); + if(settings[SET_BARCODE_REGEX]) { + this.patronBarcodeRegex = new RegExp(settings[SET_BARCODE_REGEX].value) + } else { + this.patronBarcodeRegex = newRegExp(/^\d/); + // this assumes barcodes start with digits + } // Subtract the timeout warning interval from the configured timeout // so that when taken together they add up to the configured amount. -- 2.11.0