Bugzilla – Attachment 42355 Details for
Bug 14673
Renewals cause Sipserver to crash
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14673 Work around change to AddIssue return
Bug-14673-Work-around-change-to-AddIssue-return.patch (text/plain), 3.07 KB, created by
Chris Cormack
on 2015-09-03 21:03:29 UTC
(
hide
)
Description:
Bug 14673 Work around change to AddIssue return
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2015-09-03 21:03:29 UTC
Size:
3.07 KB
patch
obsolete
>From 79983aee4ed812821491239f6b923cc70bc7b002 Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Tue, 11 Aug 2015 16:51:53 +0100 >Subject: [PATCH] Bug 14673 Work around change to AddIssue return > >Return from AddIssue used to be due date or undef. >Now it is less straightforward returning am issue object >if an issue row is created or undef. If the issue is a renewal >undef is returned. As that case was not handled properly it >caused the server site to crash the listener causing a >communications error on the client. > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >We have this patch in production, it does solve the issue >--- > C4/SIP/ILS/Transaction/Checkout.pm | 23 +++++++++++++++++------ > C4/SIP/ILS/Transaction/Renew.pm | 19 +++++++++++++++++++ > 2 files changed, 36 insertions(+), 6 deletions(-) > >diff --git a/C4/SIP/ILS/Transaction/Checkout.pm b/C4/SIP/ILS/Transaction/Checkout.pm >index 6a77aa3..0422712 100644 >--- a/C4/SIP/ILS/Transaction/Checkout.pm >+++ b/C4/SIP/ILS/Transaction/Checkout.pm >@@ -140,17 +140,28 @@ sub do_checkout { > # . "w/ \$borrower: " . Dumper($borrower) > . "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv); > my $issue = AddIssue( $borrower, $barcode, $overridden_duedate, 0 ); >- my $due_dt = dt_from_string( $issue->date_due() ); >- if ($due_dt) { >- $self->{due} = $due_dt->clone(); >- } else { >- $self->{due} = undef; >- } >+ $self->{due} = duedatefromissue($issue, $itemnumber); > > #$self->{item}->due_date($due); > $self->ok(1); > return $self; > } > >+sub duedatefromissue { >+ my ($iss, $itemnum) = @_; >+ my $due_dt; >+ if (defined $iss ) { >+ $due_dt = dt_from_string( $iss->date_due() ); >+ } # renew from AddIssue ?? >+ else { >+ # need to reread the issue to get due date >+ $iss = C4::Circulation::GetItemIssue($itemnum); >+ if ($iss && $iss->{date_due} ) { >+ $due_dt = dt_from_string( $iss->{date_due} ); >+ } >+ } >+ return $due_dt; >+} >+ > 1; > __END__ >diff --git a/C4/SIP/ILS/Transaction/Renew.pm b/C4/SIP/ILS/Transaction/Renew.pm >index e0f905b..e0e82ce 100644 >--- a/C4/SIP/ILS/Transaction/Renew.pm >+++ b/C4/SIP/ILS/Transaction/Renew.pm >@@ -47,6 +47,7 @@ sub do_renew_for { > if ($renewokay){ > $self->{due} = undef; > my $issue = AddIssue( $borrower, $self->{item}->id, undef, 0 ); >+ $self->{due} = duedatefromissue($issue, $self->{item}->{itemnumber}); > my $due_date = dt_from_string( $issue->date_due() ); > if ($due_date) { > $self->{due} = $due_date; >@@ -68,4 +69,22 @@ sub do_renew { > return $self->do_renew_for($borrower); > } > >+ >+sub duedatefromissue { >+ my ($iss, $itemnum) = @_; >+ my $due_dt; >+ if (defined $iss ) { >+ $due_dt = dt_from_string( $iss->date_due() ); >+ } # renew from AddIssue ?? >+ else { >+ # need to reread the issue to get due date >+ $iss = C4::Circulation::GetItemIssue($itemnum); >+ if ($iss && $iss->{date_due} ) { >+ $due_dt = dt_from_string( $iss->{date_due} ); >+ } >+ } >+ return $due_dt; >+} >+ >+ > 1; >-- >2.5.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 14673
:
41452
|
42355
|
43014
|
44328
|
44548