Bug 15270 - Koha::Objects->find can exploded if searching for nonexistent record
Summary: Koha::Objects->find can exploded if searching for nonexistent record
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-01 10:08 UTC by Jonathan Druart
Modified: 2017-06-14 22:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Who signed the patch off:
Text to go in the release notes:
On 3.20.05, if AnonymousPatron is set to a nonexistent borrowernumber, the about.pl crashes with: DBIC result type isn't of the type Borrower at /home/koha/src/Koha/Objects.pm line 87.
Version(s) released in:


Attachments
Bug 15270: Make Koha::Objects->find return undef instead of crashing (2.51 KB, patch)
2015-12-01 10:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15270: Add regression tests for Koha::Objects->find (1.67 KB, patch)
2015-12-01 10:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
[FOR 3.20.X ONLY] Bug 15270: Make Koha::Objects->find return undef instead of crashing (1.12 KB, patch)
2015-12-01 10:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15270: Make Koha::Objects->find return undef instead of crashing (1.35 KB, patch)
2015-12-01 13:54 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 15270: Add regression tests for Koha::Objects->find (1.72 KB, patch)
2015-12-01 13:56 UTC, Magnus Enger
Details | Diff | Splinter Review
[PASSED QA] Bug 15270: Make Koha::Objects->find return undef instead of crashing (1.42 KB, patch)
2015-12-06 21:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 15270: Add regression tests for Koha::Objects->find (1.79 KB, patch)
2015-12-06 21:31 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2015-12-01 10:08:13 UTC
On 3.20.05, if AnonymousPatron is set to a nonexistent borrowernumber, the about.pl crashes with

  DBIC result type  isn't of the type Borrower at /home/koha/src/Koha/Objects.pm line 87.

This was fixed on master by

commit 6882949b1b3bd1284e3d2877244a64edee3883ca
Date:   Wed Apr 8 06:38:34 2015 -0400
    Bug 13967 - System preferences need a package
Comment 1 Jonathan Druart 2015-12-01 10:15:31 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2015-12-01 10:17:52 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-12-01 10:18:10 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-12-01 10:19:26 UTC
The 2 patches are for 3.20.x but it would be good to get the first one (the tests) on master too.
Comment 5 Magnus Enger 2015-12-01 13:54:45 UTC Comment hidden (obsolete)
Comment 6 Magnus Enger 2015-12-01 13:56:06 UTC Comment hidden (obsolete)
Comment 7 Frédéric Demians 2015-12-02 07:12:24 UTC
(In reply to Jonathan Druart from comment #4)
> The 2 patches are for 3.20.x but it would be good to get the first one (the
> tests) on master too.

I can see the bug and the solution. Can I QA myself those patches, and then pushed them on 3.20, am I supposed to wait someone else from the QA team to validate this before?
Comment 8 Jonathan Druart 2015-12-02 08:24:00 UTC
(In reply to Frédéric Demians from comment #7)
> (In reply to Jonathan Druart from comment #4)
> > The 2 patches are for 3.20.x but it would be good to get the first one (the
> > tests) on master too.
> 
> I can see the bug and the solution. Can I QA myself those patches, and then
> pushed them on 3.20, am I supposed to wait someone else from the QA team to
> validate this before?

I don't know, I think the RMaints have the responsibility of keeping their branch stable :)
Since you are releasing at the end of the month, maybe it is worth to wait for another pair of eyes?
Comment 9 Katrin Fischer 2015-12-02 23:22:12 UTC
Please wait for the QA team. If something is urgently needed, feel free to nudge me or one of the others about it.
Comment 10 Frédéric Demians 2015-12-03 06:23:21 UTC
(In reply to Katrin Fischer from comment #9)
> Please wait for the QA team. If something is urgently needed, feel free to
> nudge me or one of the others about it.

OK
Comment 11 Katrin Fischer 2015-12-06 21:31:02 UTC
Created attachment 45438 [details] [review]
[PASSED QA] Bug 15270: Make Koha::Objects->find return undef instead of crashing

On 3.20.05, if AnonymousPatron is set to a nonexistent borrowernumber, the about.pl crashes with

  DBIC result type  isn't of the type Borrower at /home/koha/src/Koha/Objects.pm line 87.

This was fixed on master by
  commit 6882949b1b3bd1284e3d2877244a64edee3883ca
  Date:   Wed Apr 8 06:38:34 2015 -0400
      Bug 13967 - System preferences need a package

Test plan:
Set the AnonymousPatron pref to a nonexistent borrowernumber
Go on about.pl
Without this patch, you get the error.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Set AnonymousPatron pref to a nonexistent borrowernumber. Before the
patch, about.pl shows a nasty error. After applying the patch the
error is gone. Tests in t/db_dependent/Objects.t pass.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2015-12-06 21:31:30 UTC
Created attachment 45439 [details] [review]
[PASSED QA] Bug 15270: Add regression tests for Koha::Objects->find

Signed-off-by: Magnus Enger <magnus@libriotech.no>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Frédéric Demians 2015-12-07 06:33:01 UTC
This patch has been pushed to 3.20.x, will be in 3.20.7.