Bugzilla – Attachment 82658 Details for
Bug 21842
always test Koha::ItemType in defined
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21842: test Koha::ItemType in defined in order recieve items table
Bug-21842-test-KohaItemType-in-defined-in-order-re.patch (text/plain), 1.81 KB, created by
Fridolin Somers
on 2018-11-27 08:09:35 UTC
(
hide
)
Description:
Bug 21842: test Koha::ItemType in defined in order recieve items table
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2018-11-27 08:09:35 UTC
Size:
1.81 KB
patch
obsolete
>From 1a63140cfddf48003660612f6232bd92d9883ec0 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 15 Nov 2018 10:39:45 +0100 >Subject: [PATCH] Bug 21842: test Koha::ItemType in defined in order recieve > items table > >Like Bug 19194 calls on $itemtype->value must test the object is defined. >This patch catalogue/getitem-ajax.pl > >Test plan : >1) Define system preference item-level_itypes on "specific item" >2) Define in framework a subfield of items field : mapped on items.itype and not mandatory >3) Create an item without value on this subfield >4) Go to Acquisitions -> Find a vendor or make a new one -> create a new basket >5) Add the record from Step 1 to your basket >6) Close the basket >7) Go back to the vendor and click "Receive shipments" >8) Put in an invoice number, click Next >9) Click the "Receive" link for your item >10) Click on "Edit" in items table >11) You see item editor in a new tab >12) Change something and save >13) Without patch your change is not update > The ajax call is with HTTP 500 error containing : > Can't call method "description" on an undefined value >14) With patch items table is updated >--- > catalogue/getitem-ajax.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/catalogue/getitem-ajax.pl b/catalogue/getitem-ajax.pl >index 10df69ef75..4c688b0bf9 100755 >--- a/catalogue/getitem-ajax.pl >+++ b/catalogue/getitem-ajax.pl >@@ -73,7 +73,7 @@ if($itemnumber) { > $item->{materials} = $descriptions->{lib} // ''; > > my $itemtype = Koha::ItemTypes->find( $item->{itype} ); >- $item->{itemtype} = $itemtype->description; # FIXME Should not it be translated_description? >+ $item->{itemtype} = defined $itemtype ? $itemtype->description : q{}; # FIXME Should not it be translated_description? > } > > my $json_text = to_json( $item, { utf8 => 1 } ); >-- >2.17.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 21842
:
82354
|
82355
|
82356
|
82656
|
82657
| 82658