Created attachment 105553 [details] Incorrect search result example If you have an item that has a Lost status of "Lost" it will appear as "long overdue" in staff client search results. See attached screenshots for an example. This should display the current Lost status instead.
Created attachment 105554 [details] Correct item record example
Looking at Joe's site, this seems to be particular to items that are set to itemlost=1 (which should show "Lost") but are also still checked out. select biblionumber from items where onloan is not null and itemlost=1 Bibs listed in this report display "long overdue" as Joe has described. select biblionumber from items where onloan is null and itemlost=1 Bibs listed in this report show "Lost" as they should
I believe the issue is here: koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt: ([% onloan_items_loo.count | html %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue | html %] long overdue[% END %]) date due: [% onloan_items_loo.due_date | $KohaDates %] And that leads us to Search.pm making wrong assumptions: # if something's checked out and lost, mark it as 'long overdue' if ( $item->{itemlost} ) { $onloan_items->{$key}->{longoverdue}++; $longoverdue_count++; } And now we have an issue: we can't guarantee which value is the long overdue value lost value. If a library isn't using the long overdue prefs but using command line parameters. So maybe we need to change this to just show the lost description as is.
Created attachment 105684 [details] [review] Bug 25676: Display the correct Lost value in the result search
I had a try to fix this, but it's confusing. About "(1, 1 Lost)", I never managed to display more that 1 on the same line. For onloan items, I can only see 1 line per line (they are not grouped if same code, location, cn, etc.) The idea here was to display: (2, 1 Lost, 1 Long overdue), depending on the description in the LOST av category.
> The idea here was to display: > (2, 1 Lost, 1 Long overdue), depending on the description in the LOST av > category. I think maybe we should just give up on the grouping and say: 1 Lost, 1 Long overdue