[Bug 13025] New: Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Bug ID: 13025 Summary: Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925 Change sponsored?: --- Product: Koha Version: 3.14 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com One of our partners is seeing the following Software error intermittently on checkout: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925, <DATA> line 522. Here's the offending code: 1924 # Remove any OVERDUES related debarment if the borrower has no overdues 1925 if ( $borrowernumber 1926 && $borrower->{'debarred'} 1927 && C4::Context->preference('AutoRemoveOverduesRestrictions') 1928 && !HasOverdues( $borrowernumber ) 1929 && @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) } 1930 ) { 1931 DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); 1932 } I'm not *entirely* sure why this is happening -- HasOverdues is defined in C4/Members.pm: 53 push @EXPORT, qw( 54 &Search 55 &GetMemberDetails 56 &GetMemberRelatives ... 108 HasOverdues 109 ); and C4::Members is being included in C4/Circulation.pm: 30 use C4::Members; ... so !HasOverdues( $borrowernumber ) *shouldn't* be interpreted as a call to &C4::Circulation::HasOverdues ... nonetheless, calling 1928 && !HasOverdues( $borrowernumber ) could be re-written as 1928 && ! C4::Members::HasOverdues( $borrowernumber ) which would be un-ambiguously correct. For the sake of consistency, the call to HasOverdues at C4/Circulation.pm line 2626 should also be changed. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi --- Comment #1 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Hi! This issue is plaguing us as well. It manifested as we barred all Borrowers with fines during the new-year. Now our check-in machine is cutting the connection all the time :) I managed to fix the issue and will share a patch ASAP. Since Mr. Chittenden has identified this issue, I wonder why he hasn't shared a patch already? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 --- Comment #2 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 35037 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35037&action=edit Bug 13025 - Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925 This error only appears when using the SIPServer, it doesn't manifest when using the SIP unit tests or when using the staff client. -------------------- ------------------ PREPARE THE TEST ------------------ -------------------- 0a. Find a borrower. 0b. Find an Item (cardnumber 'debar123') and check-out to the borrower 0c. Find a borrower and add a manual debarrment to it, indefinetely in effect. This is the default behaviour. 0d. Configure and start a SIP-server which you can access with telnet. See http://wiki.koha-community.org/wiki/Koha_SIP2_server_setup In this example, the Borrower defined as the Check-out/in machine has the following credentials: username: herkules password: palautathan branchcode: JOE_JOE but you are free to use your own, it doesn't affect this test plan. 0e. access your server with telnet ----------------------- --------------------- REPLICATE THE ISSUE --------------------- ----------------------- 1. Paste the following SIP-command to login: 9300CNherkules|COpalautathan|CPJOE_JOE| 2. Paste the following SIP-command to check-in the Item of the debarred Borrower: 09N20140721 07501620140721 075016AP|AO|ABdebar123|AC|BIN| 3. The connection should die and in the SIP Server's error log you can find the following error: Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925 -------------------- ------------------ AFTER THIS PATCH ------------------ -------------------- Redo steps 1-2. 3. No error is given and the connection doesn't die. No unit tests included and never will, because setting up the test environment would be very tedious. It is entirely possible but the scaffolding required is beyond the scope of this patch. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |olli-antti.kivilahti@jns.fi |ity.org | Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13532, | |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13261 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- I am curious to know why C4::Circulation does not see HasOverdues. The subroutine is exported from C4::Member, which is used in C4::Circ. What I missed? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 M. de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #4 from M. de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #3)
I am curious to know why C4::Circulation does not see HasOverdues. The subroutine is exported from C4::Member, which is used in C4::Circ. What I missed?
Yeah, must be something strange in C4/SIP/.. ? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 --- Comment #5 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- I agree. The issue is very strange, but I have a gut feeling finding the root cause is not going to be easy. Regardless using implicit function calls is bad practice (imho) and the Perl manual somewhere says that the Perl compiler/interpreter tries it's best to do-the-right-thing TM but implicit declarations are not always dealt with as is expected to happen. I'll test some more whether breaking the multiline boolean soup will fix anything. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 --- Comment #6 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- !!!!! This is the original code !!!!! # Remove any OVERDUES related debarment if the borrower has no overdues if ( $borrowernumber&& $borrower->{'debarred'} && C4::Context->preference('AutoRemoveOverduesRestrictions') && !HasOverdues( $borrowernumber ) && @{ GetDebarments({ borrowernumber => $borrowernumber, type => 'OVERDUES' }) } ) { DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); } !!!!! I tried with this one, but got the same error !!!!! # Remove any OVERDUES related debarment if the borrower has no overdues if ( not(HasOverdues( $borrowernumber )) ) { DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); } !!!!! If someone knows what is the root cause, let me know :) !!!!! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.14 |master -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35037|0 |1 is obsolete| | --- Comment #7 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 35040 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35040&action=edit [SIGNED-OFF] Bug 13025 - Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925 This error only appears when using the SIPServer, it doesn't manifest when using the SIP unit tests or when using the staff client. -------------------- ------------------ PREPARE THE TEST ------------------ -------------------- 0a. Find a borrower. 0b. Find an Item (cardnumber 'debar123') and check-out to the borrower 0c. Find a borrower and add a manual debarrment to it, indefinetely in effect. This is the default behaviour. 0d. Configure and start a SIP-server which you can access with telnet. See http://wiki.koha-community.org/wiki/Koha_SIP2_server_setup In this example, the Borrower defined as the Check-out/in machine has the following credentials: username: herkules password: palautathan branchcode: JOE_JOE but you are free to use your own, it doesn't affect this test plan. 0e. access your server with telnet ----------------------- --------------------- REPLICATE THE ISSUE --------------------- ----------------------- 1. Paste the following SIP-command to login: 9300CNherkules|COpalautathan|CPJOE_JOE| 2. Paste the following SIP-command to check-in the Item of the debarred Borrower: 09N20140721 07501620140721 075016AP|AO|ABdebar123|AC|BIN| 3. The connection should die and in the SIP Server's error log you can find the following error: Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925 -------------------- ------------------ AFTER THIS PATCH ------------------ -------------------- Redo steps 1-2. 3. No error is given and the connection doesn't die. No unit tests included and never will, because setting up the test environment would be very tedious. It is entirely possible but the scaffolding required is beyond the scope of this patch. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Olli-Antti Kivilahti from comment #6)
!!!!! I tried with this one, but got the same error !!!!! # Remove any OVERDUES related debarment if the borrower has no overdues if ( not(HasOverdues( $borrowernumber )) ) { DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' }); }
!!!!! If someone knows what is the root cause, let me know :) !!!!!
I don't understand the problem here. The error comes from HasOverdues, and it is still called in this code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 --- Comment #9 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 35087 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35087&action=edit Bug 13025 - Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925 This error only appears when using the SIPServer, it doesn't manifest when using the SIP unit tests or when using the staff client. -------------------- ------------------ PREPARE THE TEST ------------------ -------------------- 0a. Find a borrower. 0b. Find an Item (cardnumber 'debar123') and check-out to the borrower 0c. Find a borrower and add a manual debarrment to it, indefinetely in effect. This is the default behaviour. 0d. Configure and start a SIP-server which you can access with telnet. See http://wiki.koha-community.org/wiki/Koha_SIP2_server_setup In this example, the Borrower defined as the Check-out/in machine has the following credentials: username: herkules password: palautathan branchcode: JOE_JOE but you are free to use your own, it doesn't affect this test plan. 0e. access your server with telnet ----------------------- --------------------- REPLICATE THE ISSUE --------------------- ----------------------- 1. Paste the following SIP-command to login: 9300CNherkules|COpalautathan|CPJOE_JOE| 2. Paste the following SIP-command to check-in the Item of the debarred Borrower: 09N20140721 07501620140721 075016AP|AO|ABdebar123|AC|BIN| 3. The connection should die and in the SIP Server's error log you can find the following error: Software error: Undefined subroutine &C4::Circulation::HasOverdues called at /home/koha/kohaclone/C4/Circulation.pm line 1925 -------------------- ------------------ AFTER THIS PATCH ------------------ -------------------- Redo steps 1-2. 3. No error is given and the connection doesn't die. No unit tests included and never will, because setting up the test environment would be very tedious. It is entirely possible but the scaffolding required is beyond the scope of this patch. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Note: I did not test this patch with SIP, but I did not find any regression on checking or renewing an item. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- What Perl version? I have the feeling that it should be fixed on SIP code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #35040|0 |1 is obsolete| | CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Olli! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |chris@bigballofwax.co.nz --- Comment #12 from Chris Cormack <chris@bigballofwax.co.nz> --- Pushed to 3.18.x will be in 3.18.4 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mtj@kohaaloha.com Keywords| |rel_3_16_candidate --- Comment #13 from Mason James <mtj@kohaaloha.com> --- (In reply to Chris Cormack from comment #12)
Pushed to 3.18.x will be in 3.18.4
Pushed to 3.16.x, will be in 3.16.8 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13025 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_3_16_candidate | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org