Bugzilla – Attachment 144639 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
Add-fallback-redirect-to-additem-op-if-currentitem.patch (text/plain), 1.67 KB, created by
Paul Derscheid
on 2022-12-16 08:50:07 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 08:50:07 UTC
Size:
1.67 KB
patch
obsolete
>From 188219c9e063907f1b74c6edcebe9fa5ab6b8b47 Mon Sep 17 00:00:00 2001 >From: LMSCloudPaulD <paul.derscheid@lmscloud.de> >Date: Wed, 14 Dec 2022 11:33:37 +0100 >Subject: [PATCH] Add fallback redirect to additem op if \$current_item is > undefined > >https://bugs.koha-community.org/show_bug.cgi?id=32418 >--- > cataloguing/additem.pl | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index ed31390663..4c1a015f62 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -462,15 +462,14 @@ if ($op eq "additem") { > } elsif ($op eq "edititem") { > #------------------------------------------------------------------------------- > # retrieve item if exist => then, it's a modif >- $current_item = Koha::Items->find($itemnumber)->unblessed; >- # FIXME Handle non existent item >- $nextop = "saveitem"; >+ $current_item = Koha::Items->find($itemnumber)->unblessed or undef; >+ $nextop = $current_item ? "saveitem" : "additem"; > #------------------------------------------------------------------------------- > } elsif ($op eq "dupeitem") { > #------------------------------------------------------------------------------- > # retrieve item if exist => then, it's a modif >- $current_item = Koha::Items->find($itemnumber)->unblessed; >- # FIXME Handle non existent item >+ $current_item = Koha::Items->find($itemnumber)->unblessed or undef; >+ 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; >-- >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