[Koha] Internal Server Error when trying to authenticate

Michael Kuhn mik at adminkuhn.ch
Sat Sep 15 01:06:13 NZST 2018


Hi

Just for the record... Yesterday I wrote:

 > When using Koha 16.05 we have set up a script "auth_divibib.pl" to
 > authenticate against Divibib (a German company that does about the
 > same as Overdrive). The script contained lines like
 >
 > use C4::Members;
 > ...
 > use DateTime;
 > my $today = DateTime->today->date;
 > ...
 > my ($borr) = C4::Members::GetMemberDetails($borrowernumber);
 >    return("1", "0", "0") if defined ($borr->{'debarred'});
 >    if ($borr->{'dateexpiry'} lt $today) {
 >      return("-3", "0", "0")
 >    }
 >
 > After updating to Koha 18.05 unfortunately this is no more working as
 > before. We have seen in Bug
 > https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17578 there
 > was a change in C4::Members so we tried to change
 > C4::Members::GetMemberDetails to C4::Members::GetMember in the code.
 > But still the file throws an "Internal Server Error" in the browser
 > and the following error appears in file "plack-error.log".
 >
 > Variable "$today" is not available at
 > /usr/share/koha/opac/cgi-bin/opac/auth_divibib.pl line 164.
 > Undefined subroutine &C4::Members::GetMember called at
 > /usr/share/koha/opac/cgi-bin/opac/auth_divibib.pl line 158.
 >
 > Can anyone give us a hint how to solve that problem?

Reason of the problem was the newly introduced class "Koha::Patrons" 
about which I didn't know.

However I was able to use the new class methods instead of the old ones. 
I especially liked the new class methods "is_debarred", "is_expired" and 
"get _age".

There was only one problem with the documentation that should probably 
be corrected:

https://perldoc.koha-community.org/Koha/Patron.html actually shows the 
content of "Koha::Patrons" (with "s" at the end) even though the 
document itself says the class is named "Koha::Patron". So the file name 
"Patron.html" and the NAME "Koha::Patron" in the document should 
probably be corrected.

while

https://perldoc.koha-community.org/Koha/Patrons.html actually shows the 
content of another class named "Koha::Patron" (without "s" at the end). 
So the file name "Patrons.html" should probably be corrected.

Both classes do contain a method named "guarantor", the rest is different.

Best wishes: Michael
-- 
Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
T 0041 (0)61 261 55 61 · E mik at adminkuhn.ch · W www.adminkuhn.ch


More information about the Koha mailing list