Bug 1750 - Report bor_issues_top erroneous and truncated results.
authorMason James <mtj@kohaaloha.com>
Fri, 1 Apr 2016 02:23:22 +0000 (15:23 +1300)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 27 Apr 2016 15:10:55 +0000 (17:10 +0200)
Signed-off-by: Mason James <mtj@kohaaloha.com>

TEST PLAN
---------
1) Ensure you have some checkouts
2) Home -> Reports
        -> Patrons with the most checkouts
3) Click 'Submit'
   -- you get a list
4) Click a patron name.
5) Note the borrower number.
6) In MySQL run something like:
   > UPDATE borrower SET firstname=NULL WHERE borrowernumber=####
7) Refresh the report page
   -- name goes totally blank
8) apply patch
9) Refresh the report page
   -- only first name is lost
10) run koha qa test tools

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Brendan Gallagher <bredan@bywatersolutions.com>
(cherry picked from commit b859739c2a6dc899176276022782ac3af7a0ad0c)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
(cherry picked from commit 8f4df78bd46e9e9c02f2841ef6bd1bba2bb39c6c)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

reports/bor_issues_top.pl

index 23ccc9e..0d61c73 100755 (executable)
@@ -280,7 +280,7 @@ sub calculate {
     my $strcalc ;
 
 # Processing average loanperiods
-    $strcalc .= "SELECT  CONCAT(borrowers.surname , \",\\t\",borrowers.firstname),  COUNT(*) AS RANK, borrowers.borrowernumber AS ID";
+    $strcalc .= "SELECT  CONCAT_WS('', borrowers.surname , \",\\t\", borrowers.firstname),  COUNT(*) AS RANK, borrowers.borrowernumber AS ID";
     $strcalc .= " , $colfield " if ($colfield);
     $strcalc .= " FROM `old_issues`
                   LEFT JOIN  borrowers  USING(borrowernumber)