Bugzilla – Attachment 64694 Details for
Bug 18870
Patron Clubs breaks when creating a club
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18870: Using a prefetch to get relationship data rather than a method
Bug-18870-Using-a-prefetch-to-get-relationship-dat.patch (text/plain), 1.50 KB, created by
Aleisha Amohia
on 2017-06-28 03:21:51 UTC
(
hide
)
Description:
Bug 18870: Using a prefetch to get relationship data rather than a method
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-06-28 03:21:51 UTC
Size:
1.50 KB
patch
obsolete
>From d0f0979453b78a8fca3c9882e53be4f402065783 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 28 Jun 2017 03:19:06 +0000 >Subject: [PATCH] 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 >--- > Koha/Club.pm | 12 ------------ > clubs/clubs.pl | 2 +- > 2 files changed, 1 insertion(+), 13 deletions(-) > >diff --git a/Koha/Club.pm b/Koha/Club.pm >index f55bfb5..cecc0bf 100644 >--- a/Koha/Club.pm >+++ b/Koha/Club.pm >@@ -39,18 +39,6 @@ Koha::Club - Koha Club Object class > > =cut > >-=head3 club_template >- >-=cut >- >-sub club_template { >- my ($self) = @_; >- >- return unless $self->club_template_id(); >- >- return Koha::Club::Templates->find( $self->club_template_id() ); >-} >- > =head3 club_fields > > =cut >diff --git a/clubs/clubs.pl b/clubs/clubs.pl >index 4429e23..5fb236f 100755 >--- a/clubs/clubs.pl >+++ b/clubs/clubs.pl >@@ -47,7 +47,7 @@ my $club_template = $club_template_id ? Koha::Club::Templates->find( $club_templ > my $club = $club_id ? Koha::Clubs->find( $club_id ) : undef; > > my @club_templates = Koha::Club::Templates->search(); >-my @clubs = Koha::Clubs->search(); >+my @clubs = Koha::Clubs->search({}, { prefetch => 'club_template' }); > > $template->param( > stored => $stored, >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18870
:
64694
|
64834
|
64836
|
64837