https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31154
--- Comment #24 from Jonathan Druart <[email protected]> --- (In reply to Marcel de Rooy from comment #22) > Jonathan, left comment17 and comment19 for your consideration :) Why didn't you add that on the original bug report? :) (In reply to Marcel de Rooy from comment #17) > =head3 new > > my $form = Koha::UI::Form::Builder::Item->new( > { > biblionumber => $biblionumber, > item => $current_item, > } > ); > > Constructor. > biblionumber should be passed if we are creating a new item. > For edition, an hashref representing the item to edit item must be passed. > > Hmm. Why did the author not just pick the biblionumber of the item? The item is not created yet, and so does not belongs to the biblio yet. But I agree we could add it to the item hashref, remove the param and use item->{biblionumber} instead. (In reply to Marcel de Rooy from comment #19) > We are really wasting resources here. > > First we do: > my %itemdata = map { lc($_->{barcode}) => $_->{itemnumber} } @{ > Koha::Items->search({ barcode => { -in => \@barcodelist } }, { columns => [ > 'itemnumber', 'barcode' ] } )->unblessed }; > > Lets discard that info. > And later do: > > sub build_table { > my ( $self, $params ) = @_; > my %itemnumbers_to_idx = map { $self->{itemnumbers}->[$_] => $_ } > 0..$#{$self->{itemnumbers}}; > my $items = Koha::Items->search( { itemnumber => $self->{itemnumbers} } > ); > > We are looking up all items again ;) From controller we are only fetching itemnumber and barcode. That's extra processing for the "max items to display" feature. From the module we are fetching everything. I am expecting the query from the controller to be very fast, using DBMS indexes. What did we do before 28445 and friends? -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
