Bug 40873 - AV dropdowns in OPAC don't use lib_opac values
Summary: AV dropdowns in OPAC don't use lib_opac values
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Eric Phetteplace
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-24 19:29 UTC by Eric Phetteplace
Modified: 2025-09-24 19:52 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40873: AV dropdowns in OPAC don't use lib_opac (1.65 KB, patch)
2025-09-24 19:51 UTC, Eric Phetteplace
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Phetteplace 2025-09-24 19:29:06 UTC
The OPAC version of av-build-dropbox.inc uses av.lib instead of av.lib_opac so even if your AV category has OPAC-friendly text it is not used.

I discovered this specifically when using the SUGGEST_FORMAT item types for purchase suggestions. I created the category, added several values, gave them all a concise "lib" value and some a more explanatory "lib_opac" value. When I visited the OPAC's suggestions page /cgi-bin/koha/opac-suggestions.pl?op=add_form I saw the form only used the "lib" values.

The code is in koha-tmpl/opac-tmpl/bootstrap/en/includes/av-build-dropbox.inc

I suspect many patron-facing AVs don't have lib_opac values because they're not used anywhere, so changing the dropbox code to use lib_opac could have negative side effects for many existing instances. Would it make sense to check if an AV has lib_opac, use that, and default to lib if not available? This should make the transition seamless, unless libraries put inaccurate values in their lib_opac which they wouldn't notice until now.
Comment 1 Eric Phetteplace 2025-09-24 19:41:41 UTC
Well I see why I discovered this on the purchase suggestions, that appears to be the only place the OPAC av-build-dropbox.inc is used. But if this include is used again in the future, it would really be nice if it worked with the lib_opac values. Patch forthcoming.
Comment 2 Eric Phetteplace 2025-09-24 19:51:43 UTC
Created attachment 186901 [details] [review]
Bug 40873: AV dropdowns in OPAC don't use lib_opac

To test (ktd):
- Sign into the admin side
- Go to Administration > Authorized Values
- Edit or add to SUGGEST_FORMAT such that one AV has a different lib_opac
- Sign into the public catalog
- Go to purchase suggestions /cgi-bin/koha/opac-suggestions.pl?op=add_form
- Note that the AV in the 'Item type' dropdown does not use your lib_opac text
- Apply the patch and refresh the page
- Now the AV uses the lib_opac text

Sponsored-By: California College of the Arts