Bugzilla – Attachment 158264 Details for
Bug 32379
CRASH: Can't call method "itemlost" on an undefined value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32379: Add check on existing item
Bug-32379-Add-check-on-existing-item.patch (text/plain), 1.19 KB, created by
David Nind
on 2023-11-02 14:10:39 UTC
(
hide
)
Description:
Bug 32379: Add check on existing item
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-11-02 14:10:39 UTC
Size:
1.19 KB
patch
obsolete
>From d576e587155e31ddf3856d5c6a17df9977309254 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 2 Nov 2023 10:47:50 +0000 >Subject: [PATCH] Bug 32379: Add check on existing item > >Simplest fix; bail out with output_error. > >Test plan: >Try /cgi-bin/koha/cataloguing/additem.pl?biblionumber=1&op=saveitem&itemnumber=999999 >Note: Replace 1 by existing biblionumber, and iitem 999999 should not exist. >You should get the 404 screen now. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >--- > cataloguing/additem.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 1e397a0de2..bd7b297109 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -549,7 +549,10 @@ if ($op eq "additem") { > > my $itemnumber = $input->param('itemnumber'); > my $item = Koha::Items->find($itemnumber); >- # FIXME Handle non existent item >+ unless ($item) { >+ C4::Output::output_error( $input, '404' ); >+ exit; >+ } > my $olditemlost = $item->itemlost; > my @columns = Koha::Items->columns; > my $new_values = $item->unblessed; >-- >2.30.2
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 32379
:
158240
|
158264
|
158385