[Koha-bugs] [Bug 26587] detail.pl is very slow for records with many items

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 30 02:22:04 CEST 2021


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26587

--- Comment #11 from David Cook <dcook at prosentient.com.au> ---
Hey Björn, have you tested these patches? 

I haven't tested them, but at a glance it looks like they contain errors.

1)
For instance, in the first one, $av_cache doesn't look like it's declared
anywhere. I think that will probably throw a fatal error (or at best a
warning). You should be declaring that before the loop in GetItemsInfo. 

You're also using fairly deep hash structures which could break. For instance:
$av_cache->{$data->{frameworkcode}}->{'items.stack'}->{$data->{stack}}->{lib} =
$data->{stack};

If $data->{frameworkcode} or more likely $data->{stack} don't exist , then
you're going to probably get a fatal error. You might want to wrap some of this
cache code in a function with more checks/conditions in it.

2)
I think that the second patch will generate either fatal errors or warnings as
well since you're not testing for the existence of $self->{branches} before
tyring $self->{branches}->{$branchcode}. 

You can either create $self->{branches} in a "sub new" function or just test
for it first. Something like "$self->{branches} = {} unless $self->{branches}".
Then You can test for $self->{branches}->{$branchcode} because you've
initialized $self->{branches} as a hashref.

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


More information about the Koha-bugs mailing list