Bugzilla – Attachment 149857 Details for
Bug 32563
Reservedate becomes expirationdate in some cases
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32563: Cloning $self->reservedate leads to error 500
0001-Bug-32563-Cloning-self-reservedate-leads-to-error-50.patch (text/plain), 1.72 KB, created by
Emmi Takkinen
on 2023-04-19 10:32:43 UTC
(
hide
)
Description:
Bug 32563: Cloning $self->reservedate leads to error 500
Filename:
MIME Type:
Creator:
Emmi Takkinen
Created:
2023-04-19 10:32:43 UTC
Size:
1.72 KB
patch
obsolete
>From bc2d1078c18a032c72c9d4371a3f39c42c9821b4 Mon Sep 17 00:00:00 2001 >From: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> >Date: Wed, 19 Apr 2023 13:25:25 +0300 >Subject: [PATCH] Bug 32563: Cloning $self->reservedate leads to error 500 > >If DefaultHoldExpirationdate is set and I trap a hold and revert the hold's waiting >status and then try to cancel the hold, I get an error. > >To test: >1. Go to /cgi-bin/koha/admin/preferences.pl?op=search&searchfield=DefaultHoldExpirationdate >2. Setup default expiration date to be 1 year from reserve date for example. >3. Switch to catalog to any biblio with item for example /cgi-bin/koha/catalogue/detail.pl?biblionumber=1 and place a hold for any borrower. >4. Check in an item from the biblio you reserved and your hold gets trapped. >5. Go to the biblio and to it's holds page and revert the waiting status of your hold. >6. Notice that expiration date is empty. >7. Cancel the hold and get an error. >8. Apply this patch. >9. Repeat step above, but now no error should be raised. > >Also prove prove t/db_dependent/Hold.t > >Sponsored-by: Koha-Suomi Oy >--- > Koha/Hold.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index 8e314d25b9..ac0b0ff5ce 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -895,8 +895,11 @@ sub _set_default_expirationdate { > my $timeunit = > C4::Context->preference('DefaultHoldExpirationdateUnitOfTime') || 'days'; > >+ my $reservedate = dt_from_string( $self->reservedate ); >+ my $reservedate_clone = $reservedate->clone; >+ > $self->expirationdate( >- dt_from_string( $self->reservedate->clone )->add( $timeunit => $period ) ); >+ $reservedate_clone->add( $timeunit => $period ) ); > } > > =head3 _move_to_old >-- >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 32563
:
145003
|
145573
| 149857