[Koha-bugs] [Bug 2975] New: Offline circ tries to circ on biblio-level "itemtype"

bugzilla-daemon at pippin.metavore.com bugzilla-daemon at pippin.metavore.com
Fri Feb 20 20:53:13 CET 2009


http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=2975

           Summary: Offline circ tries to circ on biblio-level "itemtype"
           Product: Koha
           Version: HEAD
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P3
         Component: Circulation
        AssignedTo: galen.charlton at liblime.com
        ReportedBy: joe.atzberger at liblime.com
         QAContact: koha-bugs at lists.koha.org
                CC: emily.funk at liblime.com


Offline circ is confused about retrieving the issuing rule.

The code at lines 240-246 is:

  my $branchcode = C4::Context->userenv->{branch};
  my $borrower = GetMember( $circ->{ 'cardnumber' }, 'cardnumber' );
  my $item = GetBiblioFromItemNumber( undef, $circ->{ 'barcode' } );
  my $issue = GetItemIssue( $item->{'itemnumber'} );

  my $issuingrule = GetIssuingRule( $borrower->{ 'categorycode' }, $item->{
'itemtype' }, $branchcode );


Note that $item is actually a biblio!  So this is a problem for GetIssuingRule,
since the biblio level data may not correspond to the correct circ rule for the
itype, or to any circ rule at all.  In at least one client's case,
biblio.itemtype is routinely undefined.

The result is to fallback to the default rule.  If no default rule is defined,
the circ period is effectively ZERO days, meaning the book is checked out, but
DUE TODAY.  (This was the symptom reported by our client.)  The workaround is
to define a default rule that will catch most of the cases.

I believe offline circ is the last part of Koha that has not been adapted to
circ on items.itype.  It should be brought up to date and the variable names
fixed for clarity.  

Here's the command line test (w/ proper ENV variables set) that I used to
replicate what the above lines are doing, showing the empty itemtype.

perl -e 'use C4::Biblio; use C4::Members; use C4::Circulation;
$b=GetMember(29301000242809, "cardnumber"); 
print "cardnumber and categorycode: ", $b->{cardnumber}, " ",
$b->{categorycode}, "\n"; 
$biblio=GetBiblioFromItemNumber( undef,39301001819082); 
print "biblio: ", $biblio->{biblionumber}, " ", $biblio->{title}, "\n"; 
print "itemtype: ", $biblio->{itemtype}, "\n";
$rule=GetIssuingRule($b->{categorycode}, $biblio->{itemtype}); '

Outputs:
cardnumber and categorycode: 29301000242809 RES
biblio: 53498 AVP
itemtype: 

Please consider fixing this with the NULL borrowernumber in issues problem at
the same time.




------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.



More information about the Koha-bugs mailing list