[Bug 40475] New: Item type not considered for next available hold in OPAC
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40475 Bug ID: 40475 Summary: Item type not considered for next available hold in OPAC Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Hold requests Assignee: koha-bugs@lists.koha-community.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, lisette@bywatersolutions.com, tomascohen@gmail.com I was discussing CanBookBeReserved with Pedro on bug 15516 when I noticed that the $itemtype in the following line of opac/opac-reserve.pl looks like it'll always be "undef" for "next available" holds: my $status = CanBookBeReserved( $borrowernumber, $biblioNum, $branch, { itemtype => $itemtype } )->{status}; -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40475 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=15516 -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40475 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- In reserve/request.pl we just use this code: my $canReserve = CanBookBeReserved( $patron->borrowernumber, $biblionumber ); CanItemBeReserved( $patron, $item_object, undef, { get_from_cache => 1 } )->{status}; So it looks like the majority of CanBookBeReserved never runs because $params->{itemtype} will always be null. But that might be OK, because at the end of CanBookBeReserved we iterate through all the items attached to that bib and we check them using CanItemBeReserved... -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40475 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Note we didn't notice this during manual testing but it came up when looking at t/db_dependent/Reserves.t -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40475 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Item type not considered |Majority of |for next available hold in |CanBookBeReserved might be |OPAC |dead code? -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40475 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to David Cook from comment #0)
I was discussing CanBookBeReserved with Pedro on bug 15516 when I noticed that the $itemtype in the following line of opac/opac-reserve.pl looks like it'll always be "undef" for "next available" holds:
my $status = CanBookBeReserved( $borrowernumber, $biblioNum, $branch, { itemtype => $itemtype } )->{status};
Are you sure? Turn on AllowHoldItemTypeSelection https://snipboard.io/sBaKNe.jpg If I select "Book" here, I hit CanBookBeReserved with itemtype=BK -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40475 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #3)
(In reply to David Cook from comment #0)
I was discussing CanBookBeReserved with Pedro on bug 15516 when I noticed that the $itemtype in the following line of opac/opac-reserve.pl looks like it'll always be "undef" for "next available" holds:
my $status = CanBookBeReserved( $borrowernumber, $biblioNum, $branch, { itemtype => $itemtype } )->{status};
Are you sure?
No, that's why I framed the bug report title as a question.
Turn on AllowHoldItemTypeSelection
https://snipboard.io/sBaKNe.jpg If I select "Book" here, I hit CanBookBeReserved with itemtype=BK
Thanks for sharing that. That's really helpful. It looks like there are a few bugs in the staff interface: it looks like "./reserve/placerequest.pl" isn't using the itemtype with "CanBookBeReserved", and "request.pl" is sending 2 "itemtype" arguments due to a duplicated "Request specific item type" field, so only the first field will ever work. I'll raise a different report for those. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org