Summary: | Report bor_issues_top erroneous and truncated results | ||
---|---|---|---|
Product: | Koha | Reporter: | Chris Cormack <chris> |
Component: | Reports | Assignee: | Chris Cormack <chris> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | brendan, f.demians, julian.maurice, mtj, mtompset |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Attachments: |
Bug 1750 - Report bor_issues_top erroneous and truncated results.
before/after pic Bug 1750 - Report bor_issues_top erroneous and truncated results. Bug 1750 - Report bor_issues_top erroneous and truncated results. [PASSED QA] Bug 1750 - Report bor_issues_top erroneous and truncated results. |
Description
Chris Cormack
2010-05-21 00:34:10 UTC
Woah, i think just hit this bug in 2016?! I'll reopen this now.. Created attachment 49758 [details] [review] Bug 1750 - Report bor_issues_top erroneous and truncated results. Created attachment 49759 [details]
before/after pic
sorry, no test plan provided FYI: the way this bug can be revealed is to have a borrower in the report with either a NULL 'surname' or 'firstname' value If this occurs, CONCAT() makes the borrower.name value NULL (bad!) Created attachment 49762 [details] [review] Bug 1750 - Report bor_issues_top erroneous and truncated results. Signed-off-by: Mason James <mtj@kohaaloha.com> Comment on attachment 49762 [details] [review] Bug 1750 - Report bor_issues_top erroneous and truncated results. Review of attachment 49762 [details] [review]: ----------------------------------------------------------------- ::: reports/bor_issues_top.pl @@ +279,4 @@ > my $strcalc ; > > # Processing average loanperiods > + $strcalc .= "SELECT CONCAT_WS('', borrowers.surname , \",\\t\", borrowers.firstname), COUNT(*) AS RANK, borrowers.borrowernumber AS ID"; http://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_concat-ws Nice! CONCAT_WS skips NULL entries, but still concat's, while CONCAT gives up and returns NULL. Created attachment 49763 [details] [review] Bug 1750 - Report bor_issues_top erroneous and truncated results. 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> URL deleted as it links to the WRONG location. This works and I know that those scripts are problematic up to the point of 'should be rewritten from scratch'. So I am passing it. Anyway, I think a better solution would be to get rid of the concat altogether and handle the existence of firstname and surname on template level including the ','. Created attachment 49820 [details] [review] [PASSED QA] Bug 1750 - Report bor_issues_top erroneous and truncated results. 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> Pushed to Master - Should be in the May 2016 Release. Thanks! Patch pushed to 3.22.x, will be in 3.22.6 Pushed to 3.22.x, will be in 3.20.11. |