Bugzilla – Attachment 101450 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]
[DO NOT APPLY/PUSH] Bug 20307: Move av.category to loc.entity
Bug-20307-Move-avcategory-to-locentity.patch (text/plain), 5.85 KB, created by
Jonathan Druart
on 2020-03-23 14:24:17 UTC
(
hide
)
Description:
[DO NOT APPLY/PUSH] Bug 20307: Move av.category to loc.entity
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-23 14:24:17 UTC
Size:
5.85 KB
patch
obsolete
>From a2adabe471cf6a8ceee43075be35be3cb4d12436 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 23 Mar 2020 15:23:56 +0100 >Subject: [PATCH] Bug 20307: Move av.category to loc.entity > >--- > Koha/AuthorisedValue.pm | 12 +++++------ > Koha/Schema/Result/AuthorisedValue.pm | 2 +- > .../Result/AuthorisedValueLocalization.pm | 2 +- > t/db_dependent/AuthorisedValues.t | 20 +++++++++---------- > 4 files changed, 18 insertions(+), 18 deletions(-) > >diff --git a/Koha/AuthorisedValue.pm b/Koha/AuthorisedValue.pm >index a16e58f90c..78a994f2ec 100644 >--- a/Koha/AuthorisedValue.pm >+++ b/Koha/AuthorisedValue.pm >@@ -71,8 +71,8 @@ sub opac_translated_description { > return $self->translated_description unless $self->lib_opac; > > my $translated_description = Koha::Localizations->search({ >- code => sprintf( "%s_%s", $self->category, $self->authorised_value ), >- entity => 'authorised_values', >+ code => $self->authorised_value, >+ entity => 'authorised_values:' . $self->category, > lang => $lang, > interface => 'opac', > })->next; >@@ -97,8 +97,8 @@ sub translated_description { > } > $lang ||= C4::Languages::getlanguage; > my $translated_description = Koha::Localizations->search({ >- code => sprintf( "%s_%s", $self->category, $self->authorised_value ), >- entity => 'authorised_values', >+ code => $self->authorised_value, >+ entity => 'authorised_values:' . $self->category, > lang => $lang, > })->next; > return $translated_description >@@ -113,8 +113,8 @@ sub translated_description { > sub translated_descriptions { > my ( $self ) = @_; > my @translated_descriptions = Koha::Localizations->search( >- { entity => 'authorised_values', >- code => sprintf( "%s_%s", $self->category, $self->authorised_value ), >+ { entity => 'authorised_values:' . $self->category, >+ code => $self->authorised_value, > } > ); > return [ map { >diff --git a/Koha/Schema/Result/AuthorisedValue.pm b/Koha/Schema/Result/AuthorisedValue.pm >index e6a9b1bfa0..058da213e5 100644 >--- a/Koha/Schema/Result/AuthorisedValue.pm >+++ b/Koha/Schema/Result/AuthorisedValue.pm >@@ -159,7 +159,7 @@ __PACKAGE__->has_many( > die "no interface specified!" unless $INTERFACE; > > return ({ >- "$args->{foreign_alias}.code" => \["= CONCAT(me.category, '_', me.authorised_value)"], >+ "$args->{foreign_alias}.entity" => \["= CONCAT('authorised_values:', me.category)"], > "$args->{foreign_alias}.lang" => $LANGUAGE, > "$args->{foreign_alias}.interface" => $INTERFACE, > }); >diff --git a/Koha/Schema/Result/AuthorisedValueLocalization.pm b/Koha/Schema/Result/AuthorisedValueLocalization.pm >index be7026db1b..74da2a69fd 100644 >--- a/Koha/Schema/Result/AuthorisedValueLocalization.pm >+++ b/Koha/Schema/Result/AuthorisedValueLocalization.pm >@@ -9,7 +9,7 @@ __PACKAGE__->table_class('DBIx::Class::ResultSource::View'); > __PACKAGE__->table('authorised_value_localizations'); > __PACKAGE__->result_source_instance->is_virtual(1); > __PACKAGE__->result_source_instance->view_definition( >- "SELECT localization_id, code, lang, translation, interface FROM localization WHERE entity='authorised_values'" >+ "SELECT localization_id, entity, code, lang, translation, interface FROM localization WHERE entity LIKE 'authorised_values:%'" > ); > > __PACKAGE__->add_columns( >diff --git a/t/db_dependent/AuthorisedValues.t b/t/db_dependent/AuthorisedValues.t >index a8c29341f7..178ad6a5a5 100644 >--- a/t/db_dependent/AuthorisedValues.t >+++ b/t/db_dependent/AuthorisedValues.t >@@ -258,8 +258,8 @@ subtest "localization" => sub { > ); # no translation > Koha::Localization->new( > { >- entity => 'authorised_values', >- code => sprintf( "%s_%s", $av1->category, $av1->authorised_value ), >+ entity => 'authorised_values:' . $av1->category, >+ code => $av1->authorised_value, > lang => 'es-ES', > interface => 'intranet', > translation => 'traducción 1' >@@ -267,8 +267,8 @@ subtest "localization" => sub { > )->store; > Koha::Localization->new( > { >- entity => 'authorised_values', >- code => sprintf( "%s_%s", $av1->category, $av1->authorised_value ), >+ entity => 'authorised_values:' . $av1->category, >+ code => $av1->authorised_value, > lang => 'es-ES', > interface => 'opac', > translation => 'opac traducción 1' >@@ -276,8 +276,8 @@ subtest "localization" => sub { > )->store; > Koha::Localization->new( > { >- entity => 'authorised_values', >- code => sprintf( "%s_%s", $av1->category, $av2->authorised_value ), >+ entity => 'authorised_values:' . $av1->category, >+ code => $av2->authorised_value, > lang => 'es-ES', > interface => 'intranet', > translation => 'traducción 2' >@@ -286,8 +286,8 @@ subtest "localization" => sub { > > Koha::Localization->new( > { >- entity => 'authorised_values', >- code => sprintf( "%s_%s", $av1->category, $av1->authorised_value ), >+ entity => 'authorised_values:' . $av1->category, >+ code => $av1->authorised_value, > lang => 'fr-FR', > interface => 'intranet', > translation => 'traduction 1' >@@ -295,8 +295,8 @@ subtest "localization" => sub { > )->store; > Koha::Localization->new( > { >- entity => 'authorised_values', >- code => sprintf( "%s_%s", $av2->category, $av2->authorised_value ), >+ entity => 'authorised_values:' . $av2->category, >+ code => $av2->authorised_value, > lang => 'de-DE', > interface => 'intranet', > translation => 'Ãbersetzung 2' >-- >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