Bug 20002 - Can't call method "description" on an undefined value at /usr/share/koha/intranet/cgi-bin/members/summary-print.pl line 107.
Summary: Can't call method "description" on an undefined value at /usr/share/koha/intr...
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-17 09:01 UTC by Mohd Hafiz Yusoff
Modified: 2018-12-03 20:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Software error: (231.92 KB, image/png)
2018-01-17 09:01 UTC, Mohd Hafiz Yusoff
Details
Result NULL (14.50 KB, image/png)
2018-02-05 14:43 UTC, Mohd Hafiz Yusoff
Details
Log after edit code (3.97 KB, text/plain)
2018-02-06 03:18 UTC, Mohd Hafiz Yusoff
Details
Result on test query (26.26 KB, image/png)
2018-02-06 16:03 UTC, Mohd Hafiz Yusoff
Details
Another error log (8.43 KB, text/plain)
2018-02-06 16:04 UTC, Mohd Hafiz Yusoff
Details
942 is NULL (245.24 KB, image/png)
2018-02-06 16:04 UTC, Mohd Hafiz Yusoff
Details
Koha Item type BOOK (235.01 KB, image/png)
2018-02-06 16:05 UTC, Mohd Hafiz Yusoff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mohd Hafiz Yusoff 2018-01-17 09:01:42 UTC
Created attachment 70601 [details]
Software error:

Error on print summary
Comment 1 Katrin Fischer 2018-01-18 05:52:43 UTC
Hi Mohd, please always include some step by step information on what you did in order for the error message to show up. Thx!
Comment 2 Mohd Hafiz Yusoff 2018-01-18 07:23:37 UTC
I test

Some error show when patron borrow over 80 item. But not all patron have this error
Comment 3 Mohd Hafiz Yusoff 2018-01-18 08:04:31 UTC
On summary-print.pl line 107

$row{'itemtype_description'} = $itemtype->description; #FIXME Should not it be translated_description
Comment 4 Mohd Hafiz Yusoff 2018-01-31 12:11:30 UTC
Anybody cal help me?
Comment 5 Jonathan Druart 2018-02-05 11:49:28 UTC
It looks like you have an item that have an item type not defined in your system.


To know the item types that are not defined in Koha, you can execute the following query:
If item-level_itypes is "specific item"
   select distinct(itype) from items left join itemtypes on itype=itemtype where itemtype is null;
If item-level_itypes is "biblio record"
  select distinct(bi.itemtype) from biblioitems bi left join itemtypes it on bi.itemtype=it.itemtype where bi.itemtype is null;
Comment 6 Mohd Hafiz Yusoff 2018-02-05 14:43:14 UTC
Created attachment 71233 [details]
Result NULL

After run query, result is NULL, how next step to do?
Comment 7 Jonathan Druart 2018-02-05 15:15:28 UTC
I am sorry I have no idea then.
Do you have something else in the log? Maybe your item does not have an item type defined? Make sure your items have an item type correctly defined.

Otherwise you could apply this change:

diff --git a/members/summary-print.pl b/members/summary-print.pl
index a6a0e36194..bb57ee0d00 100755
--- a/members/summary-print.pl
+++ b/members/summary-print.pl
@@ -100,6 +100,7 @@ sub build_issue_data {
             if ( $issue->{replacementprice} );

         #find the charge for an item
+        warn "Getting charges for " . $issue->{itemnumber};
         my ( $charge, $itemtype ) =
           GetIssuingCharges( $issue->{itemnumber}, $borrowernumber );

Restart plack, then reload the page.
In the log you should see the "Getting charges for " line with the itemnumber that cause problem.
Comment 8 Mohd Hafiz Yusoff 2018-02-06 03:18:18 UTC
Created attachment 71240 [details]
Log after edit code

For your info, this problem come affer upgrade from KOHA 16.05 to 17.11


After add code

warn "Getting charges for " . $issue->{itemnumber};

Error log in attachment
Comment 9 Jonathan Druart 2018-02-06 13:34:30 UTC
What are the return of these queries:

select itype from items where itemnumber=322947;

select itemtype from biblioitems bi left join items it on bi.biblionumber=it.biblionumber where it.itemnumber=322947;

select value from systempreferences where variable="item-level_itypes";

select itemtype from itemtypes;
Comment 10 Mohd Hafiz Yusoff 2018-02-06 16:03:02 UTC
Created attachment 71256 [details]
Result on test query

Before I run the query, I edit biblio dan itemnumber for 322947 - Sorry for this.

Now I try with new error log, I found the error on itemnumber=274334 and biblionumber=121544

At biblio, Koha [default] item type 942 is NULL and Koha item type BOOK.

After run the query, result like attachment
Comment 11 Mohd Hafiz Yusoff 2018-02-06 16:04:01 UTC
Created attachment 71257 [details]
Another error log
Comment 12 Mohd Hafiz Yusoff 2018-02-06 16:04:56 UTC
Created attachment 71258 [details]
942 is NULL
Comment 13 Mohd Hafiz Yusoff 2018-02-06 16:05:33 UTC
Created attachment 71259 [details]
Koha Item type BOOK
Comment 14 Jonathan Druart 2018-02-06 16:33:20 UTC
You have item types defined at biblio level (item-level_itypes=0), but not defined in biblioitems table (942$c is empty), you need to fix your records.
Comment 15 Mohd Hafiz Yusoff 2018-02-07 01:33:07 UTC
How to query all biblio number with 942$c is empty?