From 57848b642bd60d9aade05d1c5b66784e9de28698 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 11 Oct 2013 01:46:47 +0000 Subject: [PATCH] Bug 10240: (follow-up) don't display patrons as lost or gone-no-address incorrectly Because borrowers.lost and borrowers.gonenoaddress are nullable, when downloading patron information for an offline patron sync, convert null values to zero. To test: [1] Set borrowers.lost to NULL for a patron. [2] Do an offline sync, then disconnect network access (or stop the webserver) and enter the offline interface. [3] Try checking out to the test patron. A warning will (incorrectly) disply stating that the patron's card is lost. [4] Apply the patch. [5] Do steps 2 and 3 again. This time, there will be lost card warning. Signed-off-by: Galen Charlton --- offline_circ/download.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/offline_circ/download.pl b/offline_circ/download.pl index 95c2aeaefa..edd35a604e 100755 --- a/offline_circ/download.pl +++ b/offline_circ/download.pl @@ -39,7 +39,8 @@ my $patrons_query = q{SELECT borrowers.borrowernumber, cardnumber, surname, firstname, title, othernames, initials, streetnumber, streettype, address, address2, city, state, zipcode, country, email, phone, mobile, fax, dateofbirth, branchcode, - categorycode, dateenrolled, dateexpiry, gonenoaddress, lost, debarred, + categorycode, dateenrolled, dateexpiry, COALESCE(gonenoaddress, 0) AS gonenoaddress, + COALESCE(lost, 0) AS lost, debarred, debarredcomment, SUM(accountlines.amountoutstanding) AS fine FROM borrowers LEFT JOIN accountlines ON borrowers.borrowernumber=accountlines.borrowernumber -- 2.39.5