[Bug 24464] New: Add K::A::Basket->creator
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Bug ID: 24464 Summary: Add K::A::Basket->creator Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com We need an accessor to fetch the Koha::Patron for the basket creator (a.k.a. authorisedby on the DB). -- 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=24464 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Depends on| |24463 Blocks| |20212 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Slowness in Receiving in Acquisitions https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24463 [Bug 24463] Consistent accessor-relationship naming for basket_group in Basket.pm -- 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=24464 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 97631 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97631&action=edit Bug 24464: Unit tests -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 97632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97632&action=edit Bug 24464: Add K::A::Basket->creator This patch adds a ->creator method to Koha::Acquisition::Basket to retrieve the related Koha::Patron object. Note: this should be re-done once 22658 is pushed, but at the time being, there's not patch submitted, and it is not a trivial task because of the column type missmatch. That said, the implementation of ->creator in this class is simple enough to just rewrite it once 22658 is submitted, and the tests will reflect the expected/unchanged behavior. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 David Nind <david@davidnind.com> 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=24464 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 98272 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98272&action=edit Bug 24463: Add a basket_group relationship for baskets This patch aims to bring consistency between the accessor name and the underlying relationship to ease things when using it from the API. To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! No behavior change! 3. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- Hi Tomás. I think I've somehow mucked up the sign-off - I've somehow added Bug 24463 patch to it as well.. If you could let me know how to fix it up, or reset it so I can sign-off again, that would be great! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Attachment #98272|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi David, I fixed it, the way is: Details > Edit details > Obsolete. Do you want to try again? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #6 from David Nind <david@davidnind.com> --- Thanks Katrin! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97631|0 |1 is obsolete| | --- Comment #7 from David Nind <david@davidnind.com> --- Created attachment 98275 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98275&action=edit Bug 24464: Unit tests Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #97632|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 98276 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98276&action=edit Bug 24464: Add K::A::Basket->creator This patch adds a ->creator method to Koha::Acquisition::Basket to retrieve the related Koha::Patron object. Note: this should be re-done once 22658 is pushed, but at the time being, there's not patch submitted, and it is not a trivial task because of the column type missmatch. That said, the implementation of ->creator in this class is simple enough to just rewrite it once 22658 is submitted, and the tests will reflect the expected/unchanged behavior. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Changes to to_api_mapping should not be part of this patchset. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Also, I think the method should reflect the lack of FK, something like: sub creator { my ($self) = @_; my $borrowernumber = $self->authorisedby; # FIXME missing FK here return unless $borrowernumber; return Koha::Patrons->find( $self->authorisedby ); } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #11 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #9)
Changes to to_api_mapping should not be part of this patchset.
Would you accept a follow-up patch here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #10)
Also, I think the method should reflect the lack of FK, something like: sub creator { my ($self) = @_; my $borrowernumber = $self->authorisedby; # FIXME missing FK here return unless $borrowernumber; return Koha::Patrons->find( $self->authorisedby ); }
Ok, will do. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff CC| |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98276|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #13 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 101316 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101316&action=edit Bug 24464: Add K::A::Basket->creator This patch adds a ->creator method to Koha::Acquisition::Basket to retrieve the related Koha::Patron object. Note: this should be re-done once 22658 is pushed, but at the time being, there's not patch submitted, and it is not a trivial task because of the column type missmatch. That said, the implementation of ->creator in this class is simple enough to just rewrite it once 22658 is submitted, and the tests will reflect the expected/unchanged behavior. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 101317 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101317&action=edit Bug 24464: (QA follow-up) Make the method reflect the lack of FK This patch makes it super obvious to understand by reading the code that there's originally no foreign key. To test: 1. Run the tests and notice they pass 2. Spot the # FIXME 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Tomás Cohen Arazi <tomascohen@gmail.com> 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=24464 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24918 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24918 [Bug 24918] Wrong attribute mappings in Koha::Acquisition::Basket -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|20212 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20212 [Bug 20212] Slowness in Receiving in Acquisitions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=24464 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98275|0 |1 is obsolete| | Attachment #101316|0 |1 is obsolete| | Attachment #101317|0 |1 is obsolete| | --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 101409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101409&action=edit Bug 24464: Unit tests Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 101410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101410&action=edit Bug 24464: Add K::A::Basket->creator This patch adds a ->creator method to Koha::Acquisition::Basket to retrieve the related Koha::Patron object. Note: this should be re-done once 22658 is pushed, but at the time being, there's not patch submitted, and it is not a trivial task because of the column type missmatch. That said, the implementation of ->creator in this class is simple enough to just rewrite it once 22658 is submitted, and the tests will reflect the expected/unchanged behavior. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/db_dependent/Koha/Acquisition/Basket.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 101411 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101411&action=edit Bug 24464: (QA follow-up) Make the method reflect the lack of FK This patch makes it super obvious to understand by reading the code that there's originally no foreign key. To test: 1. Run the tests and notice they pass 2. Spot the # FIXME 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24464 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #19 from Joy Nelson <joy@bywatersolutions.com> --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org