From: Bill Erickson Date: Tue, 14 May 2019 17:03:35 +0000 (-0400) Subject: LP1813633 TCN search can find deleted records X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e8f0c59da3876704fa8a13acf68768e9115023e9;p=Evergreen.git LP1813633 TCN search can find deleted records As with the XUL client, when performing a bib record TCN search (Cataloging -> Retrieve Record By TCN), first look for non-deleted records with the requested TCN. When none are found, perform a secondary search for deleted records with the requested TCN. To test in concerto: [1] Navigate to Cataloging -> Retrieve Record By TCN [2] Search for TCN value "10", which is deleted by default in Concerto. [3] Confirm the deleted record is loaded. Signed-off-by: Bill Erickson Signed-off-by: Garry Collum --- diff --git a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js index 8d3ed24a78..2988d9504c 100644 --- a/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js +++ b/Open-ILS/web/js/ui/default/staff/cat/catalog/app.js @@ -181,24 +181,29 @@ function($scope , $routeParams , $location , $q , egCore ) { .then(function(resp) { // get_barcodes - if (evt = egCore.evt.parse(resp)) { - alert(evt); // FIXME - return; + if (resp.count) { + return $q.when(resp); + } else { + // Search again including deleted records + return egCore.net.request('open-ils.search', + 'open-ils.search.biblio.tcn', args.record_tcn, true); } - if (!resp.count) { + }).then(function(resp2) { + + if (!resp2.count) { $scope.recordNotFound = args.record_tcn; $scope.selectMe = true; return; } - if (resp.count > 1) { + if (resp2.count > 1) { $scope.moreRecordsFound = args.record_tcn; $scope.selectMe = true; return; } - var record_id = resp.ids[0]; + var record_id = resp2.ids[0]; return loadRecord(record_id); }); }