[Koha] problems with koha ILS-DI 'HoldItem' function

MJ Ray mjr at phonecoop.coop
Sun Oct 23 06:39:41 NZDT 2011


Auninda Rumy Saleque <nightstalker2019 at gmail.com>
> http://localhost/cgi-bin/koha/ilsdi.pl?service=HoldItem&patron_id=1&bib_id=140&item_id=9339
> 
> i am getting an error like this one:
> 
> Software error:
> 
> Can't use string ("1") as a HASH ref while "strict refs" in use at
> /usr/share/koha/lib/C4/ILSDI/Utility.pm line 88.
> 
> Note: if the item does not exist, then it returns an xml sheet with 'record
> not found' but if everything exists, then i am getting the above error. just
> to inform, i can get item details or patron details through the ils-di
> without any problem.

Here's what I do:

1. what does /usr/share/koha/lib/C4/ILSDI/Utility.pm line 88 say
in your version?  And which version is that?

In mine, it's
    if ( $borrower->{'amountoutstanding'} > $MAXOUTSTANDING ) {

so I think $borrower is "1" instead of a hashref.  That's in a
function starting CanBookBeReserved($borrower, $biblionumber)

2. now I look at ilsdi.pl to see what it does with patron_id if
called with the parameters you give it.  It basically calls
'C4::ILSDI::Services::' . $service
(which I'm a bit doubtful of as a style, but never mind that now)
so I look at C4/ILSDI/Services.pm:/HoldItem which opens with
    my $borrowernumber = $cgi->param('patron_id');
    my $borrower = GetMemberDetails( $borrowernumber );
but then later (line  calls
    my $canbookbereserved = CanBookBeReserved( $borrowernumber, $biblionumber );
which I think it causing a problem because there's also a
CanBookBeReserved in C4::Reserves.

So I'd delete the CanBookBeReserved function from Utility.pm - 
It seems this is a known bug, so there is a patch to do it
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=6142

Can you try that change, see if it works and let the list know,
please?

I think the fix might appear in versions 3.6.1 and 3.4.6.

Hope that helps,
-- 
MJ Ray, Software Engineering Specialist, www.software.coop member.
(# number in subject emails = copy to all workers unless asked.)
Turo Technology LLP, reg'd in England+Wales, number OC303457
Reg. Office: 36 Orchard Cl., Kewstoke, Somerset, GB-BS22 9XY


More information about the Koha mailing list