Bugzilla – Attachment 187717 Details for
Bug 40324
moremember.pl crashes when a barred patron doesn't have a borrower_debarments record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40324: Prevent 500 when no borrower_debarments for debarred patrons
Bug-40324-Prevent-500-when-no-borrowerdebarments-f.patch (text/plain), 1.67 KB, created by
Jonathan Druart
on 2025-10-10 08:02:52 UTC
(
hide
)
Description:
Bug 40324: Prevent 500 when no borrower_debarments for debarred patrons
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-10 08:02:52 UTC
Size:
1.67 KB
patch
obsolete
>From fa4189e9ce2fa92a590310afd968179932116ae4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 10 Oct 2025 09:59:53 +0200 >Subject: [PATCH] Bug 40324: Prevent 500 when no borrower_debarments for > debarred patrons > >There are reports of crash when viewing patron records that are debarred >but does not have a borrower_debarments entry. > >We should know how those records have been created. It's data >inconsistency and I don't think we should deal with that in the code. >The DB structure is not really correct: we should not have >borrowers.debarred, but we kept it for historical reasons (and >reports). > >This patch fixes the 500, but there are then other problems on the >screen: >Top of the screen: >" Account restricted since " > >Under the "Restrictions (0)" tab: >"Patron is currently unrestricted." >--- > members/moremember.pl | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/members/moremember.pl b/members/moremember.pl >index 9cf8574e101..05dd317fad5 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -86,10 +86,11 @@ for (qw(gonenoaddress lost borrowernotes is_debarred)) { > $template->param( restriction_types => scalar Koha::Patron::Restriction::Types->search() ); > > if ( $patron->is_debarred ) { >+ my $restriction = $patron->restrictions->search->single; > $template->param( > 'userdebarred' => $patron->debarred, > 'debarredcomment' => $patron->debarredcomment, >- 'debarredsince' => $patron->restrictions->search()->single->created, >+ 'debarredsince' => $restriction ? $restriction->single->created : undef, > ); > > if ( $patron->debarred ne "9999-12-31" ) { >-- >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 40324
:
183850
| 187717