Skip to content

Commit

Permalink
Add additional checking if for blank values from getActiveLocation in…
Browse files Browse the repository at this point in the history
… addition to null values and add additional debugging to self check tester
  • Loading branch information
mdnoble73 committed Sep 26, 2024
1 parent 9f15e3d commit 676c3bb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions code/web/release_notes/24.09.01.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
### Sierra Updates
- Manually encode json when checking out a title to ensure statgroup is sent to the Sierra APIs as an integer. (*MDN*)

### Self Check Tester
- Add additional checking if for blank values from getActiveLocation in addition to null values and add additional debugging to self check tester. (*MDN*)

### Other updates
- Disabled the 'Show This Branch In Available At and Owning Location Facets' filter and setting as it is interacting poorly with facet labels. (*CZ*)
- Increased the length for debuginfo column in the grouped_work_debug_info table (Ticket 138696) (*KL*)
Expand Down
12 changes: 9 additions & 3 deletions code/web/services/API/UserAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -5763,7 +5763,7 @@ function endMasquerade() {
function checkoutILSItem($patronBarcode = null, $patronPassword = null, $itemBarcode = null, $activeLocationId = null): array {
if ($patronBarcode != null && $patronPassword == null && $this->context == 'internal') {
//For self check we don't require the pin, use find new user
//Call find new user just to be sure that all patron information is up to date.
//Call find new user just to be sure that all patron information is up-to-date.
$user = UserAccount::findNewUser($patronBarcode, null);
if (!$user) {
//This user no longer exists? return an error?
Expand Down Expand Up @@ -5793,11 +5793,17 @@ function checkoutILSItem($patronBarcode = null, $patronPassword = null, $itemBar
$activeLocationId = $_REQUEST['locationId'];
}
}
if (empty($itemBarcode) || empty($activeLocationId)) {
if (empty($itemBarcode)) {
return [
'success' => false,
'title' => 'Error',
'message' => 'Barcode and location id must be provided',
'message' => 'Item Barcode must be provided',
];
} elseif (empty($activeLocationId)) {
return [
'success' => false,
'title' => 'Error',
'message' => 'Active location id must be provided',
];
} else {
$location = new Location();
Expand Down
2 changes: 1 addition & 1 deletion code/web/services/ILS/SelfCheckTester.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function launch() {
global $locationSingleton;
global $library;
$location = $locationSingleton->getActiveLocation();
if ($location == null) {
if (empty($location)) {
$location = $library->getMainLocation();
}
if ($location != null) {
Expand Down

0 comments on commit 676c3bb

Please sign in to comment.