From e8e8f2d57592975b8c1fd6ab4c3fb3efb981cc47 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 1 Aug 2024 09:21:12 -0300 Subject: [PATCH] Bug 37389: (QA follow-up) Tidy Signed-off-by: Tomas Cohen Arazi --- 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