Bugzilla – Attachment 167378 Details for
Bug 37023
Filling a hold should update the timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37023: Update timestamp when filling a hold
0001-Bug-37023-Update-timestamp-when-filling-a-hold.patch (text/plain), 2.30 KB, created by
Johanna Räisä
on 2024-06-04 11:50:21 UTC
(
hide
)
Description:
Bug 37023: Update timestamp when filling a hold
Filename:
MIME Type:
Creator:
Johanna Räisä
Created:
2024-06-04 11:50:21 UTC
Size:
2.30 KB
patch
obsolete
>From c6d6cc4e9fd94f0d7553fb14357acdebf0093922 Mon Sep 17 00:00:00 2001 >From: Johanna Raisa <johanna.raisa@gmail.com> >Date: Tue, 4 Jun 2024 14:44:56 +0300 >Subject: [PATCH] Bug 37023: Update timestamp when filling a hold > >This patch updates the timestamp of the hold when it is filled and moved to old_reserves. > >Test plan: >1) Apply the patch >2) prove t/db_dependent/Koha/Hold.t > >Sponsored-by: Koha-Suomi Oy >--- > Koha/Hold.pm | 1 + > t/db_dependent/Koha/Hold.t | 8 +++++--- > 2 files changed, 6 insertions(+), 3 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 12109ad573..cd41ca853e 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -848,6 +848,7 @@ sub fill { > { > found => 'F', > priority => 0, >+ timestamp => dt_from_string->strftime( '%Y-%m-%d %H:%M:%S' ), > $params->{item_id} ? ( itemnumber => $params->{item_id} ) : (), > } > ); >diff --git a/t/db_dependent/Koha/Hold.t b/t/db_dependent/Koha/Hold.t >index 99dae133a2..009104b578 100755 >--- a/t/db_dependent/Koha/Hold.t >+++ b/t/db_dependent/Koha/Hold.t >@@ -106,7 +106,7 @@ subtest 'pickup_library/branch tests' => sub { > > subtest 'fill() tests' => sub { > >- plan tests => 14; >+ plan tests => 15; > > $schema->storage->txn_begin; > >@@ -136,6 +136,7 @@ subtest 'fill() tests' => sub { > biblionumber => $biblio->id, > borrowernumber => $patron->id, > itemnumber => $item->id, >+ timestamp => dt_from_string('2021-06-25 14:05:35'), > priority => 10, > } > } >@@ -148,9 +149,9 @@ subtest 'fill() tests' => sub { > > my $interface = 'api'; > C4::Context->interface($interface); >- >+ my $hold_timestamp = $hold->timestamp; > my $ret = $hold->fill; >- >+ > is( ref($ret), 'Koha::Hold', '->fill returns the object type' ); > is( $ret->id, $hold->id, '->fill returns the object' ); > >@@ -159,6 +160,7 @@ subtest 'fill() tests' => sub { > > is( $old_hold->id, $hold->id, 'reserve_id retained' ); > is( $old_hold->priority, 0, 'priority set to 0' ); >+ isnt( $old_hold->timestamp, $hold_timestamp, 'timestamp updated' ); > is( $old_hold->found, 'F', 'found set to F' ); > > subtest 'item_id parameter' => sub { >-- >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 37023
:
167378
|
167457
|
171904