Bug 16009 - crash displaying pending offline circulations
Summary: crash displaying pending offline circulations
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords: regression
Depends on: 15344
Blocks:
  Show dependency treegraph
 
Reported: 2016-03-08 23:20 UTC by Galen Charlton
Modified: 2019-06-27 09:24 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16009: fix GetMember() search on NULL/undef values (2.19 KB, patch)
2016-03-09 01:45 UTC, Galen Charlton
Details | Diff | Splinter Review
Bug 16009: fix GetMember() search on NULL/undef values (2.23 KB, patch)
2016-03-11 01:05 UTC, Srdjan Jankovic
Details | Diff | Splinter Review
Bug 16009: fix GetMember() search on NULL/undef values (2.31 KB, patch)
2016-03-11 10:30 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Galen Charlton 2016-03-08 23:20:41 UTC
Displaying a list of pending offline circulation actions can now fail if the cardnumber is null (as can be the case with a return).  The associated crash is:

DBD::mysql::st execute failed: called with 1 bind variables when 0 are needed [for Statement "SELECT borrowers.*, categories.category_type, categories.description
    FROM borrowers
    LEFT JOIN categories on borrowers.categorycode=categories.categorycode WHERE cardnumber IS NULL"] at /usr/share/koha/lib/C4/Members.pm line 451.

This appears to be a consequence of bug 15344; it turns out that GetMemberDetails handled cardnumber => NULL better than GetMember does at present.

This looks like it affects master, 3.20.8+, and 3.22.2+
Comment 1 Galen Charlton 2016-03-09 01:45:50 UTC Comment hidden (obsolete)
Comment 2 Galen Charlton 2016-03-10 13:49:56 UTC
Bumping severity up as this is a regression.
Comment 3 Srdjan Jankovic 2016-03-11 01:05:18 UTC Comment hidden (obsolete)
Comment 4 Srdjan Jankovic 2016-03-11 01:08:23 UTC
Just an idea, in such situations, maybe have 2 patches:
* Tests that fail
* Fix (that makes tests pass)
Comment 5 Jonathan Druart 2016-03-11 10:30:40 UTC
Created attachment 49000 [details] [review]
Bug 16009: fix GetMember() search on NULL/undef values

This patch fixes a bug whereby GetMember(searchfield => undef)
(i.e., searching for patron records where 'searchfield' is NULL)
would crash.

This fixes a regression introduced by bug 15344 that in turn
exposed a long-standing bug in GetMember().

To test:

[1] Import some offline circulation transactions that include at
    least one return.
[2] Attempt to view the list of pending transactions; a crash
    will occur.
[3] Apply the patch and view the list of pending transactions again;
    this time, it should work.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Brendan Gallagher 2016-03-11 15:24:48 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks
Comment 7 Julian Maurice 2016-03-14 09:13:01 UTC
Patch pushed to 3.22.x, will be in 3.22.5