[Koha-bugs] [Bug 9351] item type not recorded correctly in statistics for returns and some local use

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Feb 12 00:48:51 CET 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9351

--- Comment #49 from David Cook <dcook at prosentient.com.au> ---
(In reply to Katrin Fischer from comment #48)
> Hm, are you sure?
> 
> >This patch corrects this problem by getting itemtype from $item->{'itype'} >which comes from item or biblio level in GetItem().
> 
> Maybe the reason is that I had both and it only falls back if you have no
> item level itypes? Fridolin, could you take a quick look and confirm what is
> he correct default behaviour?
> 
> I would be really interesting to know if record level itypes still used by a
> lot of libraries.

Hehe. I'm never sure after you ask me if I'm sure ;).

Here's my quick review of the source:

--
Instances of UpdateStats():

1) AddReturn()
Currently uses: "$biblio->{'itemtype'}"
$item defined by: C4::GetItem()

This is interesting because $biblio actually appears to be null in AddReturn().
So it looks like all the stats for returns will probably have a null itemtype.
(My claim should only be false if there's a function that modifies $biblio
without taking it as an argument, which... would also be suboptimal.)


2) AddRenewal()
Currently uses: $item->{itype}
$item defined by: C4::GetItem()


3) CanBookBeIssued() 
Currently uses: $item->{'itemtype'}
$item defined by: C4::GetItem()

It appears that $item->{'itemtype'} is actually defined by $item->{'itype'}, so
changing this should just improve readability. The values should be identical.

NOTE: This only uses UpdateStats() for statistical borrowers

4) AddIssue()
Currently uses: $item->{'itype'}
$item defined by: C4::GetItem()

--

In regards to C4::GetItem():

$item->{itype} will equal "biblioitems.itemtype" if "items.itype" is false.

Katrin: I don't know what that means exactly. I always use item-level item
types. I assume this means that if one were to use biblio-level itemtypes, that
items.itype would be false (ie null or blank) and thus biblioitems.itemtype
would be places in $item->{itype}...

However, regardless of the behaviour in C4::GetItem(), using $item->{'itype'}
when calling UpdateStats() should guarantee consistency. 

At the moment, it looks to me that AddRenewal(), CanBookBeIssued(), and
AddIssue() are probably using item-level itemtypes... while AddReturn() is
probably using a blank value (as UpdateStats will use a blank value if itemtype
doesn't exist).

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list