Bugzilla – Attachment 169956 Details for
Bug 37389
REST API queries joining on extended_attributes may cause severe performance issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37389: (QA follow-up) Tidy
Bug-37389-QA-follow-up-Tidy.patch (text/plain), 4.01 KB, created by
Pedro Amorim
on 2024-08-01 16:25:35 UTC
(
hide
)
Description:
Bug 37389: (QA follow-up) Tidy
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-08-01 16:25:35 UTC
Size:
4.01 KB
patch
obsolete
>From e8e8f2d57592975b8c1fd6ab4c3fb3efb981cc47 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 1 Aug 2024 09:21:12 -0300 >Subject: [PATCH] Bug 37389: (QA follow-up) Tidy > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/ILL/Requests.pm | 3 +-- > Koha/Objects/Mixin/ExtendedAttributes.pm | 4 ++-- > Koha/Patrons.pm | 2 +- > t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t | 7 +++---- > 4 files changed, 7 insertions(+), 9 deletions(-) > mode change 100644 => 100755 t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t > >diff --git a/Koha/ILL/Requests.pm b/Koha/ILL/Requests.pm >index 39ca48d3e9..3f15d660f3 100644 >--- a/Koha/ILL/Requests.pm >+++ b/Koha/ILL/Requests.pm >@@ -22,7 +22,6 @@ use Modern::Perl; > use Koha::Database; > use Koha::ILL::Request; > use Koha::ILL::Request::Config; >-use Koha::Objects::Mixin::ExtendedAttributes; > > use base qw(Koha::Objects::Mixin::ExtendedAttributes Koha::Objects); > >@@ -112,7 +111,7 @@ sub search_incomplete { > =cut > > sub extended_attributes_config { >- my ( $self ) = @_; >+ my ($self) = @_; > return { > 'id_field' => { 'foreign' => 'illrequest_id', 'self' => 'illrequest_id' }, > 'key_field' => 'type', >diff --git a/Koha/Objects/Mixin/ExtendedAttributes.pm b/Koha/Objects/Mixin/ExtendedAttributes.pm >index 386d657535..f18bb006d2 100644 >--- a/Koha/Objects/Mixin/ExtendedAttributes.pm >+++ b/Koha/Objects/Mixin/ExtendedAttributes.pm >@@ -200,7 +200,7 @@ sub _rewrite_related_metadata_query { > sub _build_extended_attributes_relations { > my ( $self, $types ) = @_; > >- return if( !grep ( /extended_attributes/, keys %{$self->_resultset->result_source->_relationships} ) ); >+ return if ( !grep ( /extended_attributes/, keys %{ $self->_resultset->result_source->_relationships } ) ); > > my $ea_config = $self->extended_attributes_config; > >@@ -231,4 +231,4 @@ sub _build_extended_attributes_relations { > return map { 'extended_attributes_' . $_ } @{$types}; > } > >-1; >\ No newline at end of file >+1; >diff --git a/Koha/Patrons.pm b/Koha/Patrons.pm >index 813d741c2a..ccc7dad65c 100644 >--- a/Koha/Patrons.pm >+++ b/Koha/Patrons.pm >@@ -571,7 +571,7 @@ sub filter_by_have_permission { > =cut > > sub extended_attributes_config { >- my ( $self ) = @_; >+ my ($self) = @_; > return { > 'id_field' => { 'foreign' => 'borrowernumber', 'self' => 'borrowernumber' }, > 'key_field' => 'code', >diff --git a/t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t b/t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t >old mode 100644 >new mode 100755 >index 6d84c4c0cf..29a09e7991 >--- a/t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t >+++ b/t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t >@@ -44,13 +44,13 @@ subtest 'extended_attributes patrons join searches() tests' => sub { > my $attribute_type_1 = $builder->build( > { > source => 'BorrowerAttributeType', >- value => { repeatable => 1, is_date => 0, code => 'CODE_1' }, >+ value => { repeatable => 1, is_date => 0, code => 'CODE_1' }, > } > ); > my $attribute_type_2 = $builder->build( > { > source => 'BorrowerAttributeType', >- value => { repeatable => 1, is_date => 0, code => 'CODE_2' } >+ value => { repeatable => 1, is_date => 0, code => 'CODE_2' } > } > ); > >@@ -71,7 +71,7 @@ subtest 'extended_attributes patrons join searches() tests' => sub { > > my $patrons_search = Koha::Patrons->search( > [ >- '-and'=>[ >+ '-and' => [ > { > 'extended_attributes.attribute' => { 'like' => '%Bar%' }, > 'extended_attributes.code' => $attr1->code >@@ -105,7 +105,6 @@ subtest 'extended_attributes patrons join searches() tests' => sub { > > is( $patrons_search2->count, 0, "Second patrons extended_attribute 'AND' query works." ); > >- > my $patrons_search3 = Koha::Patrons->search( > [ > [ >-- >2.39.2
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 37389
:
169130
|
169133
|
169140
|
169149
|
169159
|
169178
|
169185
|
169189
|
169191
|
169192
|
169234
|
169243
|
169244
|
169245
|
169246
|
169317
|
169318
|
169569
|
169570
|
169583
|
169584
|
169585
|
169586
|
169850
|
169851
|
169944
|
169945
|
169946
|
169954
|
169955
| 169956