Bugzilla – Attachment 122130 Details for
Bug 28586
Cannot resolve a claim
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28586: (follow-up) updated_by should be set
Bug-28586-follow-up-updatedby-should-be-set.patch (text/plain), 2.52 KB, created by
Nick Clemens (kidclamp)
on 2021-06-18 13:04:55 UTC
(
hide
)
Description:
Bug 28586: (follow-up) updated_by should be set
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2021-06-18 13:04:55 UTC
Size:
2.52 KB
patch
obsolete
>From 931dbb97755dd2558fbc12432762754daa26f0f7 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 17 Jun 2021 16:02:35 -0300 >Subject: [PATCH] Bug 28586: (follow-up) updated_by should be set > >This patch makes the route set the 'updated_by' attribute as well, when >resolving a return claim through the API. > >Tests are added for this behavior. > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ prove t/db_dependent/api/v1/return_claims.t >=> SUCCESS: Tests pass! updated_by is set correctly! >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/REST/V1/ReturnClaims.pm | 1 + > t/db_dependent/api/v1/return_claims.t | 10 ++++++++-- > 2 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/ReturnClaims.pm b/Koha/REST/V1/ReturnClaims.pm >index d33a326e55..118e11782a 100644 >--- a/Koha/REST/V1/ReturnClaims.pm >+++ b/Koha/REST/V1/ReturnClaims.pm >@@ -171,6 +171,7 @@ sub resolve_claim { > resolution => $resolution, > resolved_by => $resolved_by, > resolved_on => \'NOW()', >+ updated_by => $resolved_by, > } > )->store; > $claim->discard_changes; >diff --git a/t/db_dependent/api/v1/return_claims.t b/t/db_dependent/api/v1/return_claims.t >index 1664102c6f..aac1a3db5e 100755 >--- a/t/db_dependent/api/v1/return_claims.t >+++ b/t/db_dependent/api/v1/return_claims.t >@@ -175,7 +175,7 @@ subtest 'update_notes() tests' => sub { > > subtest 'resolve_claim() tests' => sub { > >- plan tests => 8; >+ plan tests => 9; > > $schema->storage->txn_begin; > >@@ -204,7 +204,12 @@ subtest 'resolve_claim() tests' => sub { > > my $claim_id = $claim->id; > >- $claim->created_by(undef)->store; # resolve the claim must work even if the created_by patron has been removed >+ $claim->set( >+ { >+ created_by => undef, >+ updated_by => undef, >+ } >+ )->store; # resolve the claim must work even if the created_by patron has been removed > > # Resolve a claim > $t->put_ok( >@@ -217,6 +222,7 @@ subtest 'resolve_claim() tests' => sub { > $claim->discard_changes; > is( $claim->resolution, "FOUNDINLIB" ); > is( $claim->resolved_by, $librarian->id ); >+ is( $claim->updated_by, $librarian->id ); > ok( $claim->resolved_on ); > > # Make sure the claim doesn't exist on the DB anymore >-- >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 28586
:
122083
|
122092
|
122110
|
122111
|
122124
|
122125
|
122126
|
122127
|
122129
| 122130