Summary: | Patron Clubs breaks when creating a club | ||
---|---|---|---|
Product: | Koha | Reporter: | Aleisha Amohia <aleisha> |
Component: | Tools | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | blocker | ||
Priority: | P5 - low | CC: | fridolin.somers, jonathan.druart, julian.maurice, m.de.rooy, rsmalley |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18862 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19214 |
||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 12461, 18179 | ||
Bug Blocks: | |||
Attachments: |
Bug 18870: Using a prefetch to get relationship data rather than a method
Bug 18870: Force scalar context for Koha::Club methods [SIGNED-OFF] Bug 18870: Force scalar context for Koha::Club methods Bug 18870: Force scalar context for Koha::Club methods |
Description
Aleisha Amohia
2017-06-27 22:21:19 UTC
Created attachment 64694 [details] [review] 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 This patch cannot be tested yet as something is broken in the DBIx relationships. See Bug 18862 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) Created attachment 64834 [details] [review] 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. Created attachment 64836 [details] [review] [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> Created attachment 64837 [details] [review] 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> Pushed to master for 17.11, thanks to everybody involved! Pushed to 17.05.x, will be in 17.05.02 Patron clubs is a 17.05 feature, so this patch is not relevant for 16.11.x. |