Bugzilla – Attachment 143361 Details for
Bug 26635
Expand coded values in REST API call
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26635: (QA follow-up) Rename key _str to _strings
Bug-26635-QA-follow-up-Rename-key-str-to-strings.patch (text/plain), 5.64 KB, created by
Martin Renvoize
on 2022-11-07 12:30:39 UTC
(
hide
)
Description:
Bug 26635: (QA follow-up) Rename key _str to _strings
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-11-07 12:30:39 UTC
Size:
5.64 KB
patch
obsolete
>From 538b5e100757e7dc8a724660c5cd549ea59629f8 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 4 Nov 2022 18:07:28 +0000 >Subject: [PATCH] Bug 26635: (QA follow-up) Rename key _str to _strings > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Object.pm | 2 +- > t/db_dependent/Koha/Object.t | 10 +++--- > t/db_dependent/Koha/REST/Plugin/Objects.t | 38 +++++++++++------------ > 3 files changed, 25 insertions(+), 25 deletions(-) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index 187ba00769..fcebdade9a 100644 >--- a/Koha/Object.pm >+++ b/Koha/Object.pm >@@ -605,7 +605,7 @@ sub to_api { > } > } > >- $json_object->{_str} = $avs >+ $json_object->{_strings} = $avs > if $av_expand; > > if ($embeds) { >diff --git a/t/db_dependent/Koha/Object.t b/t/db_dependent/Koha/Object.t >index 47346c5850..fd06f7821d 100755 >--- a/t/db_dependent/Koha/Object.t >+++ b/t/db_dependent/Koha/Object.t >@@ -329,7 +329,7 @@ subtest "to_api() tests" => sub { > is( ref($hold_api->{item}), 'HASH', 'Single nested object works correctly' ); > is( $hold_api->{item}->{item_id}, $item->itemnumber, 'Object embedded correctly' ); > is_deeply( >- $hold_api->{item}->{_str}, >+ $hold_api->{item}->{_strings}, > $_str, > '_str correctly added to nested embed' > ); >@@ -511,11 +511,11 @@ subtest "to_api() tests" => sub { > my $mobj = $marseille->to_api( { av_expand => 1, public => 1 } ); > my $cobj = $cordoba->to_api( { av_expand => 1, public => 0 } ); > >- ok( exists $mobj->{_str}, '_str exists for Marseille' ); >- ok( exists $cobj->{_str}, '_str exists for Córdoba' ); >+ ok( exists $mobj->{_strings}, '_str exists for Marseille' ); >+ ok( exists $cobj->{_strings}, '_str exists for Córdoba' ); > > is_deeply( >- $mobj->{_str}->{country}, >+ $mobj->{_strings}->{country}, > { > category => $category->category_name, > str => $france->lib_opac, >@@ -524,7 +524,7 @@ subtest "to_api() tests" => sub { > 'Authorised value for country expanded' > ); > is_deeply( >- $cobj->{_str}->{country}, >+ $cobj->{_strings}->{country}, > { > category => $category->category_name, > str => $argentina->lib, >diff --git a/t/db_dependent/Koha/REST/Plugin/Objects.t b/t/db_dependent/Koha/REST/Plugin/Objects.t >index eec8e048bc..079f9c77c7 100755 >--- a/t/db_dependent/Koha/REST/Plugin/Objects.t >+++ b/t/db_dependent/Koha/REST/Plugin/Objects.t >@@ -716,21 +716,21 @@ subtest 'objects.find helper with expanded authorised values' => sub { > > $t->get_ok( '/cities/' . $manuel->id => { 'x-koha-embed' => '+av_expand' } ) > ->status_is(200)->json_is( '/name' => 'Manuel' ) >- ->json_has('/_str') >- ->json_is( '/_str/country/type' => 'av' ) >- ->json_is( '/_str/country/category' => $cat->category_name ) >- ->json_is( '/_str/country/str' => $ar->lib ); >+ ->json_has('/_strings') >+ ->json_is( '/_strings/country/type' => 'av' ) >+ ->json_is( '/_strings/country/category' => $cat->category_name ) >+ ->json_is( '/_strings/country/str' => $ar->lib ); > > $t->get_ok( '/cities/' . $manuel->id => { 'x-koha-embed' => '' } ) > ->status_is(200)->json_is( '/name' => 'Manuel' ) >- ->json_hasnt('/_str'); >+ ->json_hasnt('/_strings'); > > $t->get_ok( '/cities/' . $manuela->id => { 'x-koha-embed' => '+av_expand' } ) > ->status_is(200)->json_is( '/name' => 'Manuela' ) >- ->json_has('/_str') >- ->json_is( '/_str/country/type' => 'av' ) >- ->json_is( '/_str/country/category' => $cat->category_name ) >- ->json_is( '/_str/country/str' => $us->lib ); >+ ->json_has('/_strings') >+ ->json_is( '/_strings/country/type' => 'av' ) >+ ->json_is( '/_strings/country/category' => $cat->category_name ) >+ ->json_is( '/_strings/country/str' => $us->lib ); > > $schema->storage->txn_rollback; > }; >@@ -832,20 +832,20 @@ subtest 'objects.search helper with expanded authorised values' => sub { > { 'x-koha-embed' => '+av_expand' } )->status_is(200) > ->json_has('/0')->json_has('/1')->json_hasnt('/2') > ->json_is( '/0/name' => 'Manuel' ) >- ->json_has('/0/_str') >- ->json_is( '/0/_str/country/str' => $ar->lib ) >- ->json_is( '/0/_str/country/type' => 'av' ) >- ->json_is( '/0/_str/country/category' => $cat->category_name ) >+ ->json_has('/0/_strings') >+ ->json_is( '/0/_strings/country/str' => $ar->lib ) >+ ->json_is( '/0/_strings/country/type' => 'av' ) >+ ->json_is( '/0/_strings/country/category' => $cat->category_name ) > ->json_is( '/1/name' => 'Manuela' ) >- ->json_has('/1/_str') >- ->json_is( '/1/_str/country/str' => $us->lib ) >- ->json_is( '/1/_str/country/type' => 'av' ) >- ->json_is( '/1/_str/country/category' => $cat->category_name ); >+ ->json_has('/1/_strings') >+ ->json_is( '/1/_strings/country/str' => $us->lib ) >+ ->json_is( '/1/_strings/country/type' => 'av' ) >+ ->json_is( '/1/_strings/country/category' => $cat->category_name ); > > $t->get_ok( '/cities?name=manuel&_per_page=4&_page=1&_match=starts_with' )->status_is(200) > ->json_has('/0')->json_has('/1')->json_hasnt('/2') >- ->json_is( '/0/name' => 'Manuel' )->json_hasnt('/0/_str') >- ->json_is( '/1/name' => 'Manuela' )->json_hasnt('/1/_str'); >+ ->json_is( '/0/name' => 'Manuel' )->json_hasnt('/0/_strings') >+ ->json_is( '/1/name' => 'Manuela' )->json_hasnt('/1/_strings'); > > > $schema->storage->txn_rollback; >-- >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 26635
:
111400
|
111401
|
111402
|
111411
|
111412
|
111413
|
111414
|
112538
|
112539
|
116232
|
116233
|
116234
|
116235
|
116592
|
116593
|
120698
|
120699
|
120700
|
124268
|
142761
|
142762
|
142763
|
142776
|
142792
|
142793
|
142794
|
142795
|
142796
|
142801
|
142802
|
142803
|
142804
|
142805
|
143039
|
143040
|
143041
|
143042
|
143043
|
143044
|
143073
|
143074
|
143075
|
143076
|
143077
|
143078
|
143079
|
143080
|
143127
|
143128
|
143129
|
143130
|
143131
|
143132
|
143133
|
143134
|
143276
|
143354
|
143355
|
143356
|
143357
|
143358
|
143359
|
143360
| 143361 |
143362