Bugzilla – Attachment 98875 Details for
Bug 20307
Language overlay for authorized values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20307: Fix existing tests
Bug-20307-Fix-existing-tests.patch (text/plain), 3.26 KB, created by
Martin Renvoize (ashimema)
on 2020-02-13 16:10:01 UTC
(
hide
)
Description:
Bug 20307: Fix existing tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-02-13 16:10:01 UTC
Size:
3.26 KB
patch
obsolete
>From bf5cc80e3e4d24c52ef84506dd2e328954017787 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 9 Jan 2020 11:02:33 +0100 >Subject: [PATCH] Bug 20307: Fix existing tests > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/AuthorisedValue.pm | 11 +++++++---- > t/db_dependent/AuthorisedValues.t | 11 ++++++----- > 2 files changed, 13 insertions(+), 9 deletions(-) > >diff --git a/Koha/AuthorisedValue.pm b/Koha/AuthorisedValue.pm >index 8eee2fc450..2ff8cad245 100644 >--- a/Koha/AuthorisedValue.pm >+++ b/Koha/AuthorisedValue.pm >@@ -67,15 +67,18 @@ sub opac_translated_description { > : $self->lib; > } > $lang ||= C4::Languages::getlanguage; >+ >+ return $self->translated_description unless $self->lib_opac; >+ > my $translated_description = Koha::Localizations->search({ >- code => sprintf "%s_%s", $self->category, $self->authorised_value, >+ code => sprintf( "%s_%s", $self->category, $self->authorised_value ), > entity => 'authorised_values', > lang => $lang, > interface => 'opac', > })->next; > return $translated_description > ? $translated_description->translation >- : $self->translated_description; # FIXME Is that what we really want? >+ : $self->lib_opac; > } > > =head3 translated_description >@@ -94,7 +97,7 @@ sub translated_description { > } > $lang ||= C4::Languages::getlanguage; > my $translated_description = Koha::Localizations->search({ >- code => sprintf "%s_%s", $self->category, $self->authorised_value, >+ code => sprintf( "%s_%s", $self->category, $self->authorised_value ), > entity => 'authorised_values', > lang => $lang, > })->next; >@@ -111,7 +114,7 @@ sub translated_descriptions { > my ( $self ) = @_; > my @translated_descriptions = Koha::Localizations->search( > { entity => 'authorised_values', >- code => sprintf "%s_%s", $self->category, $self->authorised_value, >+ code => sprintf( "%s_%s", $self->category, $self->authorised_value ), > } > ); > return [ map { >diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t >index d16d282731..44ae89ca09 100644 >--- a/t/db_dependent/AuthorisedValues.t >+++ b/t/db_dependent/AuthorisedValues.t >@@ -4,6 +4,7 @@ use Modern::Perl; > use Test::More tests => 15; > > use t::lib::TestBuilder; >+use t::lib::Mocks; > > use Koha::Database; > use C4::Context; >@@ -213,15 +214,15 @@ subtest 'search_by_*_field + find_by_koha_field + get_description' => sub { > is_deeply( > \@descriptions, > [ >- { >- authorised_value => '', >- lib => $av_empty_string->lib, >- opac_description => $av_empty_string->lib_opac >- }, > { > authorised_value => $av_0->authorised_value, > lib => $av_0->lib, > opac_description => $av_0->lib_opac >+ }, >+ { >+ authorised_value => '', >+ lib => $av_empty_string->lib, >+ opac_description => $av_empty_string->lib_opac > } > ], > ); >-- >2.20.1
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 20307
:
86622
|
86623
|
86624
|
86625
|
86626
|
86627
|
89538
|
91645
|
91646
|
91647
|
91648
|
91649
|
91650
|
91651
|
91653
|
92192
|
92193
|
92359
|
92360
|
92361
|
94245
|
94246
|
94247
|
94248
|
94249
|
94250
|
94251
|
94252
|
94253
|
94254
|
94255
|
94256
|
94700
|
94701
|
94702
|
94703
|
94704
|
94705
|
94706
|
94707
|
94708
|
94709
|
94710
|
94711
|
97074
|
97075
|
98863
|
98864
|
98865
|
98866
|
98867
|
98868
|
98869
|
98870
|
98871
|
98872
|
98873
|
98874
| 98875 |
98876
|
101070
|
101450