[Bug 18870] New: Patron Clubs breaks when creating a club
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 Bug ID: 18870 Summary: Patron Clubs breaks when creating a club Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: aleisha@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org To reproduce 1) Go to Tools -> Patron Clubs 2) Create a club template 3) Create a club using that template 4) Notice page breaks and you can't get back on to patron clubs This error is triggered: Template process failed: undef error - Cannot use "->find" in list context at /home/vagrant/kohaclone/Koha/Club.pm line 51. -- 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=18870 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |blocker -- 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=18870 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- 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=18870 --- Comment #1 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 64694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64694&action=edit Bug 18870: Using a prefetch to get relationship data rather than a method Using the DBIx Resultset prefetch to get club_template data about clubs rather than a built-in method. To test: 1) Confirm that creating a club works. 2) Confirm that viewing the clubs.pl page works and all data is displayed Sponsored-by: Catalyst IT -- 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=18870 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18862 -- 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=18870 --- Comment #2 from Aleisha Amohia <aleisha@catalyst.net.nz> --- This patch cannot be tested yet as something is broken in the DBIx relationships. See Bug 18862 -- 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=18870 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Aleisha, This needs a scalar: return Koha::Club::Templates->find( $self->club_template_id() ); So: return scalar Koha::Club::Templates->find( $self->club_template_id() ); See also bug 18179 (incl. comment43) -- 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=18870 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18179 -- 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=18870 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. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64694|0 |1 is obsolete| | --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 64834 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64834&action=edit Bug 18870: Force scalar context for Koha::Club methods These 2 methods are called from the template in list context. However since bug 18539 Koha::Objects->find can no longer be called in list context. Forcing the context to scalar fixes the problem and should not introduced side-effects. Test plan: - Create a club template - Create a club using this template => Without this patch you should no longer get the following error: Template process failed: undef error - Cannot use "->find" in list context at /home/vagrant/kohaclone/Koha/Club.pm line 51. -- 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=18870 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18179, 12461 Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=18179 | CC| |jonathan.druart@bugs.koha-c | |ommunity.org Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12461 [Bug 12461] Add patron clubs feature https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18179 [Bug 18179] Koha::Objects->find should not be called in list context -- 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=18870 Aleisha Amohia <aleisha@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=18870 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64834|0 |1 is obsolete| | --- Comment #5 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 64836 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64836&action=edit [SIGNED-OFF] Bug 18870: Force scalar context for Koha::Club methods These 2 methods are called from the template in list context. However since bug 18539 Koha::Objects->find can no longer be called in list context. Forcing the context to scalar fixes the problem and should not introduced side-effects. Test plan: - Create a club template - Create a club using this template => Without this patch you should no longer get the following error: Template process failed: undef error - Cannot use "->find" in list context at /home/vagrant/kohaclone/Koha/Club.pm line 51. Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 64837 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=64837&action=edit Bug 18870: Force scalar context for Koha::Club methods These 2 methods are called from the template in list context. However since bug 18539 Koha::Objects->find can no longer be called in list context. Forcing the context to scalar fixes the problem and should not introduced side-effects. Test plan: - Create a club template - Create a club using this template => Without this patch you should no longer get the following error: Template process failed: undef error - Cannot use "->find" in list context at /home/vagrant/kohaclone/Koha/Club.pm line 51. Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com 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=18870 Ruth Smalley <rsmalley@livewirewarrington.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rsmalley@livewirewarrington | |.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #64836|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=18870 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #7 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to Master |Pushed to Stable --- Comment #8 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.05.x, will be in 17.05.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Patron clubs is a 17.05 feature, so this patch is not relevant for 16.11.x. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18870 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=19214 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org