Bugzilla – Attachment 144643 Details for
Bug 32418
CRASH: Can't call method "unblessed" on an undefined value at cataloguing/additem.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32418 - Can't call method 'unblessed' on an undefined value at cataloguing/additem.pl
Bug-32418---Cant-call-method-unblessed-on-an-undef.patch (text/plain), 1.96 KB, created by
Paul Derscheid
on 2022-12-16 11:20:47 UTC
(
hide
)
Description:
Bug 32418 - Can't call method 'unblessed' on an undefined value at cataloguing/additem.pl
Filename:
MIME Type:
Creator:
Paul Derscheid
Created:
2022-12-16 11:20:47 UTC
Size:
1.96 KB
patch
obsolete
>From 4d4108b0244c0877faee5392cfd6326b2ccc820c Mon Sep 17 00:00:00 2001 >From: LMSCloudPaulD <paul.derscheid@lmscloud.de> >Date: Fri, 16 Dec 2022 12:17:11 +0100 >Subject: [PATCH] Bug 32418 - Can't call method 'unblessed' on an undefined > value at cataloguing/additem.pl > >Check whether result of Koha::Items->find is defined before invoking unblessed. If undef, redirect to additem op. > >This uses an unlabeled block so we can add a guard clause to the 'dupeitem' case and exit early with the 'last' keyword. >--- > cataloguing/additem.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 84a4e67140..cb97523fd1 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -470,7 +470,7 @@ if ($op eq "additem") { > > $nextop = $current_item ? "saveitem" : "additem"; > #------------------------------------------------------------------------------- >-} elsif ($op eq "dupeitem") { >+} elsif ($op eq "dupeitem") {{ > #------------------------------------------------------------------------------- > # retrieve item if exist => then, it's a modif > if (my $item = Koha::Items->find($itemnumber)) { >@@ -479,7 +479,7 @@ if ($op eq "additem") { > $current_item = undef; > } > >- if (!$current_item) { $nextop = "additem"; return; } >+ if (!$current_item) { $nextop = "additem"; last; } > if (C4::Context->preference('autoBarcode') eq 'incremental') { > my ( $barcode ) = C4::Barcodes::ValueBuilder::incremental::get_barcode; > $current_item->{barcode} = $barcode; >@@ -490,7 +490,7 @@ if ($op eq "additem") { > > $nextop = "additem"; > #------------------------------------------------------------------------------- >-} elsif ($op eq "delitem") { >+}} elsif ($op eq "delitem") { > #------------------------------------------------------------------------------- > # check that there is no issue on this item before deletion. > my $item = Koha::Items->find($itemnumber); >-- >2.37.1 (Apple Git-137.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 32418
:
144571
|
144639
|
144640
|
144641
|
144643
|
144794
|
144812
|
145306
|
145307
|
145505
|
146944
|
149092
|
149591
|
149626
|
149627
|
149635
|
149636
|
149637