Bugzilla – Attachment 173668 Details for
Bug 28633
Add a preferred name field to patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28633: Make 'effective_name' embeddable
Bug-28633-Make-effectivename-embeddable.patch (text/plain), 3.70 KB, created by
Emily Lamancusa (emlam)
on 2024-10-29 15:45:54 UTC
(
hide
)
Description:
Bug 28633: Make 'effective_name' embeddable
Filename:
MIME Type:
Creator:
Emily Lamancusa (emlam)
Created:
2024-10-29 15:45:54 UTC
Size:
3.70 KB
patch
obsolete
>From 25fc99e223be883271aaee7b436ceead9b8692f2 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 16 May 2024 08:44:46 -0300 >Subject: [PATCH] Bug 28633: Make 'effective_name' embeddable > >This patch makes the calculated value of `Koha::Patron->effective_name` >embeddable in the patrons routes. > >To test: >1. Apply this patch >2. Run: > $ ktd --shell > k$ prove t/db_dependent/api/v1/patrons.t >=> SUCCESS: Tests pass! >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >--- > api/v1/swagger/definitions/patron.yaml | 5 +++++ > api/v1/swagger/paths/patrons.yaml | 2 ++ > t/db_dependent/api/v1/patrons.t | 24 ++++++++++++++++++++++-- > 3 files changed, 29 insertions(+), 2 deletions(-) > >diff --git a/api/v1/swagger/definitions/patron.yaml b/api/v1/swagger/definitions/patron.yaml >index 331989f303..56e7e21ef0 100644 >--- a/api/v1/swagger/definitions/patron.yaml >+++ b/api/v1/swagger/definitions/patron.yaml >@@ -383,6 +383,11 @@ properties: > type: > - boolean > description: Protected status of the patron >+ effective_name: >+ type: >+ - string >+ - "null" >+ description: The effective name to use based on configuration (x-koha-embed) > _strings: > type: > - object >diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml >index 3cdc322445..129b2bae53 100644 >--- a/api/v1/swagger/paths/patrons.yaml >+++ b/api/v1/swagger/paths/patrons.yaml >@@ -364,6 +364,7 @@ > items: > type: string > enum: >+ - effective_name > - extended_attributes > - checkouts+count > - overdues+count >@@ -498,6 +499,7 @@ > type: string > enum: > - +strings >+ - effective_name > - extended_attributes > collectionFormat: csv > produces: >diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t >index 0e3c73e21d..77d5eca4cb 100755 >--- a/t/db_dependent/api/v1/patrons.t >+++ b/t/db_dependent/api/v1/patrons.t >@@ -81,7 +81,7 @@ subtest 'list() tests' => sub { > > subtest 'librarian access tests' => sub { > >- plan tests => 21; >+ plan tests => 22; > > $schema->storage->txn_begin; > >@@ -151,6 +151,17 @@ subtest 'list() tests' => sub { > { 'x-koha-embed' => 'extended_attributes' } ) > ->status_is( 200, "Works, doesn't explode" ); > >+ subtest "embedding 'effective_name'" => sub { >+ >+ plan tests => 3; >+ >+ $t->get_ok( "//$userid:$password@/api/v1/patrons?" >+ . 'q={"patron_id":"' >+ . $patron->id >+ . '"}' => { 'x-koha-embed' => 'effective_name' } )->status_is(200) >+ ->json_is( '/0/effective_name' => $patron->effective_name ); >+ }; >+ > subtest 'searching date and date-time fields' => sub { > > plan tests => 12; >@@ -264,7 +275,8 @@ subtest 'get() tests' => sub { > $schema->storage->txn_rollback; > > subtest 'librarian access tests' => sub { >- plan tests => 8; >+ >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -314,6 +326,14 @@ subtest 'get() tests' => sub { > ->json_is('/surname' => $patron->surname) > ->json_is('/patron_card_lost' => Mojo::JSON->false ); > >+ subtest "embedding 'effective_name'" => sub { >+ >+ plan tests => 3; >+ >+ $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id => { 'x-koha-embed' => 'effective_name' } ) >+ ->status_is(200)->json_is( '/effective_name' => $patron->effective_name ); >+ }; >+ > $schema->storage->txn_rollback; > }; > >-- >2.34.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 28633
:
123008
|
123009
|
123010
|
123658
|
125497
|
125498
|
125499
|
125500
|
126591
|
128968
|
128969
|
128970
|
130000
|
130001
|
130002
|
133445
|
133446
|
133447
|
133448
|
133449
|
133450
|
133451
|
133958
|
133959
|
133960
|
133961
|
133962
|
133963
|
133964
|
133965
|
166792
|
166793
|
166794
|
166813
|
166814
|
166815
|
166816
|
166817
|
167163
|
167164
|
173628
|
173629
|
173630
|
173631
|
173632
|
173633
|
173634
|
173664
|
173665
|
173666
|
173667
|
173668
|
173669
|
173670
|
173717
|
173718
|
173719
|
173813
|
173814
|
173815
|
173816
|
173826
|
173827
|
173828
|
173829
|
173930
|
173931
|
173932
|
173933
|
173934
|
173935
|
173936
|
174419
|
174420
|
174472
|
175177