Browse Source

A similar bug was fixed in d0028b5779

* With new SQL logic volunteer obj is empty for non-volunteers, this corrects this by creating false empty data in an new temp. object.
devel
Jonathan Rosenbaum 7 years ago
parent
commit
39234f9b10
  1. 10
      js/transaction.js

10
js/transaction.js

@ -1039,8 +1039,14 @@ $(function() {
var bikes_earned = 0;
var volunteer_hours_redeemed = 0;
var volunteer_objs = $.parseJSON(data);
var obj = volunteer_objs[0];
var volunteer_objs = $.parseJSON(data);
/*
Weird hack, before improving performance #46, there was always a property for obj,
?, which just allowed the code to work, now it is empty when a patron
has never been a volunteer, so this creates that obj & property if that is the case.
*/
var obj = volunteer_objs[0] || { volunteer: "" };
var volunteer = "", remaining = 0, vhr = "", max_bikes_earned = 0;
if (obj.volunteer) {

Loading…
Cancel
Save