Bug 37389: (QA follow-up) Tidy
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
3b613fb73f
commit
897f4f319b
4 changed files with 7 additions and 9 deletions
|
@ -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',
|
||||
|
|
|
@ -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;
|
||||
1;
|
||||
|
|
|
@ -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',
|
||||
|
|
7
t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t
Normal file → Executable file
7
t/db_dependent/Koha/Objects/Mixin/ExtendedAttributes.t
Normal file → Executable file
|
@ -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(
|
||||
[
|
||||
[
|
||||
|
|
Loading…
Reference in a new issue