Skip to content

Commit af52c1e

Browse files
gmcharltsandbergja
authored andcommitted
LP#2087873: user bucket file upload now allows for spaces inside user barcodes
This patch changes how the User Bucket patron barcode file upload process normalizes barcodes. In particular, any combination of leading and trailing whitespace and commas will get removed, leaving any internal spaces intact. Prior to this patch, a barcode value like "P 123" would end up getting searched as if it were "P". To test ------- [1] Ensure that at least one patron record has a barcode value with an embedded space, e.g., "P 123". Create a text file that contains that barcode. [2] Use the User Bucket file upload feature to attempt to add that patron to the pending list. The patron will not be added to the pending list. [3] Apply the patch and repeat step 2. This time, the patron should be added to the pending list. [4] Create a file that has several patron barcode values with varous combinations of leading and trailnig spaces and commas, then try loading it. Verify that the expected patrons are retrieved. Release-note: Patron barcode file uploads in the User Bucket's Pending User(s) list are now able to retrieve patrons whose barcode value contains embedded spaces. Signed-off-by: Galen Charlton <[email protected]> Signed-off-by: Andrea Buntz Neiman <[email protected]> Signed-off-by: Jane Sandberg <[email protected]>
1 parent a39bab6 commit af52c1e

File tree

1 file changed

+4
-2
lines changed
  • Open-ILS/web/js/ui/default/staff/circ/patron/bucket

1 file changed

+4
-2
lines changed

Open-ILS/web/js/ui/default/staff/circ/patron/bucket/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,10 @@ function($scope, $routeParams, bucketSvc , egGridDataProvider, egCore , ngTo
230230
// $scope.resetPendingList(); // ??? Add instead of replace
231231
angular.forEach(newVal.split(/\n/), function(line) {
232232
if (!line) return;
233-
// scrub any trailing spaces or commas from the barcode
234-
line = line.replace(/(.*?)($|\s.*|,.*)/,'$1');
233+
// scrub any leading or trailing spaces or commas from the barcode,
234+
// leaving any internal spaces intact
235+
line = line.replace(/^(\s|,)+/, '');
236+
line = line.replace(/(\s|,)+$/, '');
235237
barcodes.push(line);
236238

237239
});

0 commit comments

Comments
 (0)