Bug 8531

Summary: Staff hold requests generate silent errors
Product: Koha Reporter: Piotr Kowalski <kolpen>
Component: Hold requestsAssignee: Bugs List <koha-bugs>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P5 - low CC: gmcharlt, katrin.fischer
Version: 3.6   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Proposed patch to placerequest.pl

Description Piotr Kowalski 2012-07-31 08:19:01 UTC
Created attachment 11215 [details]
Proposed patch to placerequest.pl

This bug extends the bug #8474
Silent errors occur when a librarian makes holds using staff interface.
The reason is uninitialized or wrong value and generally logical mistakes in line block: 115 - 123 in module placerequest.pl
In line 115: if ($input->param('request') eq 'any'){
parameter is compared to string 'any' whereas should be 'Any'. The other wrong thing is lack of value when the parameter hasn't value 'Any'.
Due to this reasons always is realized only one line of code updating the reservation table (what is right):
AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
regardles the reservation is done on a first available or a given item.

My proposition is to modify and simplify this block of lines like that (see also attached differential listing):
if ($multi_hold) {
            my $bibinfo = $bibinfos{$biblionumber};
            AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
                       $bibinfo->{rank},$startdate,$expirationdate,$notes,$bibinfo->{title},$checkitem,$found);
        } else {
             AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
        }
    }

Proposed patch refers to Koha 3.6.4 version as well as 3.6.6 and 3.8
Comment 1 Katrin Fischer 2014-07-12 12:07:27 UTC

*** This bug has been marked as a duplicate of bug 8474 ***