[Bug 19302] New: Pass objects to IsAvailableForItemLevelRequest
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Bug ID: 19302 Summary: Pass objects to IsAvailableForItemLevelRequest Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Pass Koha::Item and Koha::Patron to C4::Reserves::IsAvailableForItemLevelRequest -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 67124 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67124&action=edit Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19300, 19301 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19300 [Bug 19300] Move C4::Reserves::OPACItemHoldsAllowed to the code namespace https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19301 [Bug 19301] Move C4::Reserves::OnShelfHoldsAllowed to the code namespace -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #2 from Josef Moravec <josef.moravec@gmail.com> --- Comment on attachment 67124 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67124 Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Review of attachment 67124: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=19302&attachment=67124) ----------------------------------------------------------------- ::: C4/Circulation.pm @@ +2665,5 @@
+ next if IsItemOnHoldAndFound( $itemnumber ); + for my $borrowernumber (@borrowernumbers) { + my $patron = $patrons{$borrowernumber} //= Koha::Patrons->find( $borrowernumber ); + next unless IsAvailableForItemLevelRequest($item, $patron); + next unless CanItemBeReserved($b,$itemnumber);
Shouldn't $b be $borrowernumber ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67124|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 68845 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68845&action=edit Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Josef Moravec from comment #2)
+ next unless CanItemBeReserved($b,$itemnumber);
Shouldn't $b be $borrowernumber ?
Yes, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Bug 19302 depends on bug 19300, which changed state. Bug 19300 Summary: Move C4::Reserves::OPACItemHoldsAllowed to the Koha namespace https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19300 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alexbuckley@catalyst.net.nz Status|Needs Signoff |Patch doesn't apply --- Comment #5 from Alex Buckley <alexbuckley@catalyst.net.nz> --- This still looks to be applicable for master as the item objects are still not being handed to C4::Reserves::IsAvailableForItemLevelRequest(). I tried applying it to master, and the patch doesn't apply cleanly (as the below output shows), can you please rebase? Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest fatal: sha1 information is lacking or useless (C4/Reserves.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-19302-Send-kohaobjects-to-C4ReservesIsAvailabl-wrc9H7.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68845|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 86119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86119&action=edit Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hayleymapley@catalyst.net.n | |z Status|Needs Signoff |Patch doesn't apply --- Comment #7 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Patch doesn't apply - merge conflicts, can you take a look? Applying: Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Using index info to reconstruct a base tree... M C4/Circulation.pm M C4/ILSDI/Services.pm M C4/Reserves.pm M opac/opac-reserve.pl M reserve/request.pl M t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t M t/db_dependent/Reserves.t Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Reserves.t Auto-merging t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t Auto-merging reserve/request.pl Auto-merging opac/opac-reserve.pl Auto-merging C4/Reserves.pm CONFLICT (content): Merge conflict in C4/Reserves.pm Auto-merging C4/ILSDI/Services.pm Auto-merging C4/Circulation.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #86119|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 88660 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88660&action=edit Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #9 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- (In reply to Jonathan Druart from comment #8)
Created attachment 88660 [details] [review] Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest
Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch
Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected
Sorry Jonathan, still has merge conflicts Applying: Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Using index info to reconstruct a base tree... M C4/Circulation.pm M C4/Reserves.pm M t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t Falling back to patching base and 3-way merge... Auto-merging t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t CONFLICT (content): Merge conflict in t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t Auto-merging C4/Reserves.pm CONFLICT (content): Merge conflict in C4/Reserves.pm Auto-merging C4/Circulation.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #88660|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 88987 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88987&action=edit Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Conflict with bug 20837 fixed! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #88987|0 |1 is obsolete| | --- Comment #12 from Hayley Mapley <hayleymapley@catalyst.net.nz> --- Created attachment 89197 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89197&action=edit Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Hayley Mapley <hayleymapley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- prove t/db_dependent/Reserves.t fails with me -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #13)
prove t/db_dependent/Reserves.t fails with me
It passes for me, which failure do you get? Is it passing on master? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- # Failed test 'patron notified when item set to waiting' # at t/db_dependent/Reserves.t line 358. # got: '0' # expected: '1' # Failed test 'patron not notified a second time (bug 11445)' # at t/db_dependent/Reserves.t line 363. # got: '0' # expected: '1' # Failed test 'can successfully generate hold slip (bug 10949)' # at t/db_dependent/Reserves.t line 374. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #16 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #14)
(In reply to Marcel de Rooy from comment #13)
prove t/db_dependent/Reserves.t fails with me
It passes for me, which failure do you get? Is it passing on master?
No, without these patches it fails too.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Marcel de Rooy from comment #16)
(In reply to Jonathan Druart from comment #14)
(In reply to Marcel de Rooy from comment #13)
prove t/db_dependent/Reserves.t fails with me
It passes for me, which failure do you get? Is it passing on master?
No, without these patches it fails too..
Will refresh my data and try again.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #89197|0 |1 is obsolete| | --- Comment #18 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 89369 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89369&action=edit Bug 19302: Send koha::objects to C4::Reserves::IsAvailableForItemLevelRequest Almost everywhere we call IsAvailableForItemLevelRequest we already have a Koha::Patron and Koha::Item object. It makes sense to use them to avoid a refetch Test plan: It would be good to test this patch on top of 19300 and 19301 and make sure everything works as expected Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Passed QA |Pushed to Master --- Comment #19 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 19.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Part of the ongoing effort release notes| |to improve the | |maintainability of our | |codebase. CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19302 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to Master |RESOLVED Version(s)| |19.05.00 released in| | --- Comment #20 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement will not be backported to 18.11.x series at this time. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org