Skip to content

Commit d2c0b8e

Browse files
Josh Stomprommorgannoble
authored andcommitted
LP#2069358 - Avoid a type error if grid isn't initialized.
Release-Note: Fixes patron bills error that causes several settings to be skipped when Uncheck Bills setting is used. If the "Uncheck bills by default" library setting is being used (set to true), there is a function call to unselect all the bills that can fail if the grid isn't already initialized. That has a side effect of skipping a bunch of settings checks after that statement. The other settings that are effected in some way are. - ui.circ.billing.amount_warn - ui.circ.billing.amount_limit - circ.staff_client.do_not_auto_attempt_print - - circ.disable_patron_credit - Controls Disabling "Convert change to credit option" - credit.processor.default - controls disabling internal CC form when there is no default, or if Stripe is the processor. Testing notes: To confirm the bug: 1. enable the "Uncheck bills by default" library setting. 2. Also enable disable patron credit, and/or any of the other above settings. 3. Log out and back in to refresh settings. 4. Open up a patron , switch to bills tab. 5. The "Convert change to credit option" will still be shown, even though disable patron credit is enabled. 6. Test functionality related to any of the other options listed above. After the fix is applied, the related functions should work correctly. Signed-off-by: Josh Stompro <[email protected]> Signed-off-by: Jennifer Weston <[email protected]> Signed-off-by: Michele Morgan <[email protected]>
1 parent 2b5b7db commit d2c0b8e

File tree

1 file changed

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

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
533533
selectOnLoad = false;
534534
// if somehow the grid finishes rendering before our settings
535535
// arrive, manually de-select everything.
536-
$scope.gridControls.selectItems([]);
536+
if (typeof $scope.gridControls.selectItems !== "undefined") {
537+
// check to make sure grid is initialized before trying to clear selections.
538+
$scope.gridControls.selectItems([]);
539+
}
537540
}
538541
if (s['ui.circ.billing.amount_warn']) {
539542
$scope.warn_amount = Number(s['ui.circ.billing.amount_warn']);

0 commit comments

Comments
 (0)