From: Jason Boyer Date: Wed, 15 Nov 2017 16:42:23 +0000 (-0500) Subject: LP1732271: Fix Non-Targeted Holds Display X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=42c0fd81125d46826ddb8decaeb867c8fc0ed128;p=working%2FEvergreen.git LP1732271: Fix Non-Targeted Holds Display If a hold hasn't been targetd yet there's no volume to call prefix() and suffix() against so the display of holds in the web client is missing all holds not currently targeting a copy. This branch wraps a test around that to prevent non-targeted holds from being accidentally hidden. Signed-off-by: Jason Boyer --- diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js index 8b1d0f447a..f99ae883b1 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/services/holds.js +++ b/Open-ILS/web/js/ui/default/staff/circ/services/holds.js @@ -489,14 +489,16 @@ function($uibModal , $q , egCore , egConfirmDialog , egAlertDialog) { ).then(function(c) { hold.current_copy().status(c) }); } - //Call number affixes are not always fleshed in the API - if (volume.prefix() && typeof volume.prefix() != 'object') { - console.debug('fetching call number prefix'); - egCore.pcrud.retrieve('acnp',volume.prefix()).then(function(p) {volume.prefix(p)}); - } - if (volume.suffix() && typeof volume.suffix() != 'object') { - console.debug('fetching call number prefix'); - egCore.pcrud.retrieve('acns',volume.suffix()).then(function(s) {volume.suffix(s)}); + if (volume) { // LP1732271: Without this check the following call to volume.prefix() causes an exception and holds without targeted copies can't be displayed. + //Call number affixes are not always fleshed in the API + if (volume.prefix() && typeof volume.prefix() != 'object') { + console.debug('fetching call number prefix'); + egCore.pcrud.retrieve('acnp',volume.prefix()).then(function(p) {volume.prefix(p)}); + } + if (volume.suffix() && typeof volume.suffix() != 'object') { + console.debug('fetching call number prefix'); + egCore.pcrud.retrieve('acns',volume.suffix()).then(function(s) {volume.suffix(s)}); + } } }