https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22690
--- Comment #107 from Ere Maijala <[email protected]> --- (In reply to Martin Renvoize from comment #98) > Comment on attachment 113967 [details] [review] > Bug 22690: Refactor merging of records to improve performance (Elasticsearch) > > Review of attachment 113967 [details] [review]: > ----------------------------------------------------------------- > > ::: Koha/Item.pm > @@ +1064,5 @@ > > +sub item_orders { > > + my ( $self ) = @_; > > + > > + my $orders = $self->_result->item_orders; > > + return Koha::Acquisition::Orders->_new_from_dbic($orders); > > In it's current form, this can result in failure.. I'm not seeing any > handling for that... > > i.e. if an item is deleted it gets moved to deleted_items but the itemnumber > remains in the aqorder_items table as there is no foreign key constraint.. > have you tested this case? (See also comment #101) The only case I can see this one fail is if the item for which this is being called Well, there's the possibility that the item gets deleted in the meantime, so (In reply to Martin Renvoize from comment #98) > Comment on attachment 113967 [details] [review] > Bug 22690: Refactor merging of records to improve performance (Elasticsearch) > > Review of attachment 113967 [details] [review]: > ----------------------------------------------------------------- > > ::: Koha/Item.pm > @@ +1064,5 @@ > > +sub item_orders { > > + my ( $self ) = @_; > > + > > + my $orders = $self->_result->item_orders; > > + return Koha::Acquisition::Orders->_new_from_dbic($orders); > > In it's current form, this can result in failure.. I'm not seeing any > handling for that... > > i.e. if an item is deleted it gets moved to deleted_items but the itemnumber > remains in the aqorder_items table as there is no foreign key constraint.. > have you tested this case? Error checking added. Not tested, however, since this should be extremely rare. I can't see this happening unelss the underlying item record for the Item instance here gets deleted while item move is being processed. There are a lot of similar accessor with the same issue. -- 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/
