It looks like the checkout operation used to return a fleshed
config.copy_status object, but that changed and we now get a
raw ccs ID back.
Retrieve the status name using the ccs ID and present that
to the users. Also, in case problems like this happen in
the future, provide a more specific error message and var
name so that it will be (hopefully!) a little clearer what
payload was expected in the first place :)
Resolves https://bugs.launchpad.net/evergreen/+bug/680575
Thanks to Jason Etheridge for a major assist with this bug.
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18897
dcc99617-32d9-48b4-a31d-
7c20da2025e4
},
'7004' : function(r) {
try {
- return r.payload.status().name();
+ status_name = obj.data.hash.ccs[ r.payload.status() ].name();
+ return status_name;
} catch (E) {
- return "copy not available: (Unexpected error: payload not available)"; // XXX
+ return "Could not retrieve the name of the current status for the copy"; // XXX
}
},
'7010' : function(r) {
found_handled = true;
break;
case 7004 /* COPY_NOT_AVAILABLE */ :
- msg += test_permit[i].desc + '\n' + document.getElementById('circStrings').getFormattedString('staff.circ.checkout.copy_status', [test_permit[i].payload.status().name()]) + '\n';
+ msg += test_permit[i].desc + '\n' + document.getElementById('circStrings').getFormattedString('staff.circ.checkout.copy_status', [obj.data.hash.ccs [test_permit[i].payload.status() ].name()]) + '\n';
found_handled = true;
break;
case 7006 /* COPY_IS_REFERENCE */ :