[open-ils-commits] r17589 - trunk/Open-ILS/xul/staff_client/server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Sep 10 16:12:49 EDT 2010
Author: phasefx
Date: 2010-09-10 16:12:44 -0400 (Fri, 10 Sep 2010)
New Revision: 17589
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/util.js
Log:
some defense in patron.util.set_penalty_css against unfleshed or partially fleshed users
Modified: trunk/Open-ILS/xul/staff_client/server/patron/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/util.js 2010-09-10 20:12:42 UTC (rev 17588)
+++ trunk/Open-ILS/xul/staff_client/server/patron/util.js 2010-09-10 20:12:44 UTC (rev 17589)
@@ -672,6 +672,7 @@
*/
var penalties = patron.standing_penalties();
+ if (!penalties) { penalties = []; }
for (var i = 0; i < penalties.length; i++) {
/* this comes from /opac/common/js/utils.js */
addCSSClass(document.documentElement,penalties[i].standing_penalty().name());
@@ -743,12 +744,12 @@
if ( get_bool( patron.juvenile() ) ) addCSSClass(document.documentElement,'PATRON_JUVENILE');
else removeCSSClass(document.documentElement,'PATRON_JUVENILE');
- if (patron.mailing_address()) {
+ if (patron.mailing_address() && typeof patron.mailing_address() == 'object') {
if (!get_bool(patron.mailing_address().valid())) {
addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
}
}
- if (patron.billing_address()) {
+ if (patron.billing_address() && typeof patron.billing_address() == 'object') {
if (!get_bool(patron.billing_address().valid())) {
addCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
}
More information about the open-ils-commits
mailing list