[Koha-bugs] [Bug 10676] OpacHiddenItems not working for restricted

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jan 4 10:50:43 CET 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10676

--- Comment #8 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
After some debugging I think I have found the reason. It won't work with the
numeric value of the authorised value used, it needs the description:

restricted: ['Restricted Access']

For other values like Damaged it will works with numerics. 

The reason is some code in GetItemsInfo:

        # get notforloan complete status if applicable
        $descriptions =
Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode =>
$data->{frameworkcode}, kohafield => 'items.notforloan', authorised_value =>
$data->{itemnotforloan} });
        $data->{notforloanvalue}     = $descriptions->{lib} // '';
        $data->{notforloanvalueopac} = $descriptions->{opac_description} // '';

        # get restricted status and description if applicable
        $descriptions =
Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode =>
$data->{frameworkcode}, kohafield => 'items.restricted', authorised_value =>
$data->{restricted} });
        $data->{restricted}     = $descriptions->{lib} // '';
        $data->{restrictedopac} = $descriptions->{opac_description} // '';

While it uses a new variable "*value*" for notforloan, it overwrites the
restricted numerical value with the description.

I think the clean solution is to change it so that OpacHiddenItems works like
for the other item fields with authorised values, using the codes.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list