Bug 13191 - Null borrowernumber in reserves table
Summary: Null borrowernumber in reserves table
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: 3.16
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-03 17:55 UTC by HB-NEKLS
Modified: 2017-06-14 22:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description HB-NEKLS 2014-11-03 17:55:54 UTC
Occasionally, we have reserves placed on our system without a linked borrowernumber. It displays as NULL in the reserves table of the database. 

I cannot recreate how this behavior is happening so far, except to say it appears to originate on the public side of the system.

Some debugging code was added to C4::Reserves::AddReserve on our system, and the logs revealed it's a call to AddReserve where no borrowernumber is passed in -- on the OPAC side. 

Has anyone else seen this behavior? Know why it's happening? Thanks!
Comment 1 Owen Leonard 2016-06-22 18:40:26 UTC
I don't see any instances in the reserves table, but I see many in old_reserves (v3.18.x). I wonder if that is the same problem.

What is the effect of having holds with no borrowernumber?
Comment 2 Katrin Fischer 2016-08-14 10:52:25 UTC
This was reported against a very old and now unmaintained version of Koha - 3.16. I am closing WONTFIX - please reopen if you can still see this happening in a more current version.

NULL borrowernumbers in old_reserves can happen when deleting a patron:
CONSTRAINT `old_reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,

In reserves the line should be deleted:
 CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,