https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35721
--- Comment #31 from Marcel de Rooy <[email protected]> --- Passing QA but this still raises questions with me. Not completely confident that this will work in some edge cases: my $transferitem = $query->param('transferitem'); + my $item = Koha::Items->find( $transferitem ); + my $transfer = $item->request_transfer({ to => $tobranch, reason => $trigger }); No blocker for now, but this looks like a potential crash. Query param not found in items? Boom. Another thing: see the other calls too. Why dont you add enqueue (or replace) here ? Could this potentially throw an exception? - ModItemTransfer( $itemnumber, $userenv_branch, $diffBranchSend, 'Reserve' ); + my $tobranch = Koha::Libraries->find( $hold->branchcode ); - my $tobranch = Koha::Libraries->find( $hold->branchcode ); + my $tobranch = $hold->pickup_library(); Why dont you use diffBranchSend here ? my $diffBranchReturned = $query->param('diffBranch'); my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef; template: 2x <input type="hidden" name="diffBranch" value="[% destbranch | html %]" /> script: destbranch => $reserve->{'branchcode'}, Looks like we first pass the reserve branchcode, we get it back and we do not use it but look it up again? @@ -170,8 +170,13 @@ + my $transfer = $item->request_transfer( { to => $tobranch, reason => 'Reserve', enqueue => 1 } ); request_transfer has: frombranch => $self->holdingbranch original call had userenv_branch instead of item holding branch: ModItemTransfer( $itemnumber, $userenv_branch, $diffBranchSend, 'Reserve' ) Question: When does this make a difference? Since we are returning an item, arent we receiving it at userenv branch? Same for the @@ -612,7 +617,10 @@ change -- 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/
