[Bug 19280] New: CanBookBeIssued must take a Koha::Patron in parameter
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Bug ID: 19280 Summary: CanBookBeIssued must take a Koha::Patron in parameter Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org We need to make subroutine from C4 use more Koha::Object objects Seeing bug 19276, starting here is a good start. -- 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=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org Depends on| |19276 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19276 [Bug 19276] CanBookBeIssued: unsuccessfully refers to borrower category_type X -- 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=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 66999 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=66999&action=edit Bug 19280: Pass a Koha::Patron to CanBookBeIssued We need to make subroutine from C4 use more Koha::Object objects Seeing bug 19276, starting here is a good start. Test plan: The tests should still pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |J.P.Knight@lboro.ac.uk --- Comment #2 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Patch fails to apply on my Kohadevbox VM and also on the PTFS-E sandbox: vagrant@kohadevbox:kohaclone(master)$ git bz apply 19280 Bug 19280 - CanBookBeIssued must take a Koha::Patron in parameter 66999 - Bug 19280: Pass a Koha::Patron to CanBookBeIssued Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 19280: Pass a Koha::Patron to CanBookBeIssued /home/vagrant/kohaclone/.git/rebase-apply/patch:24: trailing whitespace. ( $issuingimpossible, $needsconfirmation ) = CanBookBeIssued( $patron, fatal: sha1 information is lacking or useless (C4/Circulation.pm). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 19280: Pass a Koha::Patron to CanBookBeIssued 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-19280-Pass-a-KohaPatron-to-CanBookBeIssued-qZZNx2.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 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=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #66999|0 |1 is obsolete| | --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 68533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68533&action=edit Bug 19280: Pass a Koha::Patron to CanBookBeIssued We need to make subroutine from C4 use more Koha::Object objects Seeing bug 19276, starting here is a good start. Test plan: The tests should still pass. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68533|0 |1 is obsolete| | --- Comment #4 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Created attachment 68534 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68534&action=edit Bug 19280: Pass a Koha::Patron to CanBookBeIssued We need to make subroutine from C4 use more Koha::Object objects Seeing bug 19276, starting here is a good start. Test plan: The tests should still pass. Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Jon Knight <J.P.Knight@lboro.ac.uk> 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=19280 Bug 19280 depends on bug 19276, which changed state. Bug 19276 Summary: CanBookBeIssued: unsuccessfully refers to borrower category_type X https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19276 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=19280 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68534|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 68916 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68916&action=edit Bug 19280: Pass a Koha::Patron to CanBookBeIssued We need to make subroutine from C4 use more Koha::Object objects Seeing bug 19276, starting here is a good start. Test plan: The tests should still pass. Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- - $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); + $patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed [...] my $toomany = TooMany( $patron_unblessed, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } ); You do not refetch $patron_unblessed. I would opt for not refetching $patron. But this is not consistent.. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 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=19280 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 70287 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70287&action=edit Bug 19280: refresh unblessed patron too -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marcel de Rooy from comment #6)
- $patron = Koha::Patrons->find( $borrower->{borrowernumber} ); + $patron = Koha::Patrons->find( $patron->borrowernumber ); # FIXME Refetch just in case, to avoid regressions. But must not be needed
[...]
my $toomany = TooMany( $patron_unblessed, $item->{biblionumber}, $item, { onsite_checkout => $onsite_checkout, switch_onsite_checkout => $switch_onsite_checkout, } );
You do not refetch $patron_unblessed. I would opt for not refetching $patron. But this is not consistent..
Good catch Marcel. I also think it's not needed, that's why I added the FIXME. But I would prefer not to do it on this bug report as it will need more attention. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=19280 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #68916|0 |1 is obsolete| | Attachment #70287|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 70291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70291&action=edit Bug 19280: Pass a Koha::Patron to CanBookBeIssued We need to make subroutine from C4 use more Koha::Object objects Seeing bug 19276, starting here is a good start. Test plan: The tests should still pass. Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> 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=19280 --- Comment #10 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 70292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=70292&action=edit Bug 19280: refresh unblessed patron too 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=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 18.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED CC| |nick@bywatersolutions.com --- Comment #12 from Nick Clemens <nick@bywatersolutions.com> --- Enhancement, skipping for 17.11.x. Awesome work everybody! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19280 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20251 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20251 [Bug 20251] SIP checkout broken in master -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org