[Bug 18785] New: Add Koha::Subscription::biblio
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Bug ID: 18785 Summary: Add Koha::Subscription::biblio Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@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=18785 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 64197 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64197&action=edit Bug 18785: Add Koha::Subscription::biblio -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Julian Maurice <julian.maurice@biblibre.com> 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=18785 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |18426 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18426 [Bug 18426] Subscriptions batch editing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 --- Comment #2 from M. Tompsett <mtompset@hotmail.com> --- Comment on attachment 64197 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64197 Bug 18785: Add Koha::Subscription::biblio Review of attachment 64197: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=18785&attachment=64197) ----------------------------------------------------------------- ::: Koha/Subscription.pm @@ +44,5 @@
+ +sub biblio { + my ($self) = @_; + + return Koha::Biblios->find($self->biblionumber);
There are a bunch of other bugzilla issues related to ->find and a scalar context. Perhapts actually using ->find({ biblionumber => $self->biblionumber }); or I think others get lazy ->find( scalar $self->biblionumber )... or was it return scalar Koha::Biblios->find($self->biblionumber); Hmmm... anyways, this isn't right, as far as I can tell. Plus if it is singular, then why Biblios? This is the part I don't understand in this and other code. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion CC| |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to M. Tompsett from comment #2)
There are a bunch of other bugzilla issues related to ->find and a scalar context. Perhapts actually using ->find({ biblionumber => $self->biblionumber }); or I think others get lazy ->find( scalar $self->biblionumber )... or was it return scalar Koha::Biblios->find($self->biblionumber); Hmmm... anyways, this isn't right, as far as I can tell. I assume you are talking about bug 18179, but the patch I wrote doesn't make any call to 'find' in a list context. Plus, there is a check in Koha::Objects::find that prevents it to be used in a list context, so I think we're good. Callers of Koha::Subsbcription::biblio will be the ones to have to make sure it's called in scalar context.
Plus if it is singular, then why Biblios? This is the part I don't understand in this and other code. The 'find' subroutine is defined in Koha::Objects, not Koha::Object.
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Julian you must force the context to make sure the following code will not explode: my $s = Koha::Subscriptions->find(42); $template->param( biblio => $s->biblio ); Cannot use "->find" in list context at /home/vagrant/kohaclone/Koha/Subscription.pm line 48. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 --- Comment #5 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 65700 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65700&action=edit Bug 18785: Force scalar context in Koha::Subscription::biblio -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=18785 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64197|0 |1 is obsolete| | Attachment #65700|0 |1 is obsolete| | --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 67383 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67383&action=edit Bug 18785: Add the Koha::Subscription->biblio method 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=18785 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 67384 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67384&action=edit Bug 18785: Force scalar context in Koha::Subscription::biblio 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=18785 Nick Clemens <nick@bywatersolutions.com> 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=18785 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67383|0 |1 is obsolete| | Attachment #67384|0 |1 is obsolete| | --- Comment #8 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 67764 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67764&action=edit Bug 18785: Add the Koha::Subscription->biblio method Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 67765 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67765&action=edit Bug 18785: Force scalar context in Koha::Subscription::biblio Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18785 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org