[Bug 4319] waiting items cannot be reserved
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=4319 Alex Arnaud <alex.arnaud@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #50 from Alex Arnaud <alex.arnaud@biblibre.com> --- (In reply to Marcel de Rooy from comment #48)
Please squash the patches. I am not sure why you change IsAvailableForItemLevelRequest in the third patch. Please explain. Where is it called in the process? It's called in opac/opac-reserve.pl. If you remove this changes, for an item on hold in transit, you have the link "hold" in detail page but you get the message: Sorry, none of these items can be placed on hold.
You add: + my $flag = shift; This is not really a clear name ;) Where do you use this parameter ? No, it's an ugly remaining debug thing :)
+ if (Koha::Holds->search({itemnumber => $item->{itemnumber}, + found => ['W', 'T']}, + {order_by => {-asc => 'priority'}})) { Why do you order_by if you are interested only in the number ? No reason. And i need a ->count at the end because a resultset is always true. I added a test to cover that.
+ return 0; + return GetReserveStatus($item->{itemnumber}) eq "Waiting"; When will you reach this second return ? Oops! A mistake. The last is no more needed.
+my $itemsWaitingOrInTransit = Koha::Holds->search( + { + biblionumber => $biblionumber, + found => ['W', 'T'] + })->count(); + +foreach my $item ( Koha::Items->search(biblionumber => $biblionumber) ) { + $itemsWaitingOrInTransit = 1 if $item->get_transfer; +} If the flag is set, there is no need to start traversing all items or keep doing so. I change the code to avoid this
I've also squashed patch -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org