| Summary: | The system preference ILLOpacbackends does not work | ||
|---|---|---|---|
| Product: | Koha | Reporter: | Andreas Jonsson <andreas.jonsson> |
| Component: | ILL | Assignee: | Bugs List <koha-bugs> |
| Status: | NEW --- | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | CC: | lisette, pedro.amorim, tomascohen |
| Version: | 25.05 | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24806 | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Comma delimited list of Sponsors: | |
| Crowdfunding goal: | 0 | Patch complexity: | --- |
| Documentation contact: | Documentation submission: | ||
| Text to go in the release notes: | Version(s) released in: | ||
| Circulation function: | |||
|
Description
Andreas Jonsson
2025-11-18 08:33:36 UTC
Hi Andreas, I believe the behavior you describe is the functionality working as designed. (In reply to Andreas Jonsson from comment #0) > Expected behavior: > > - If user is logged, return list of backends that are 1) installed and 2) > listed in ILLOpacbackends This would imply having to update the sys pref everytime a backend is installed/uninstalled. I believe the way it's designed (e.g. show all if left empty) is to ensure that Koha systems not using this sys pref get all backends by default, which is what one would expect i.e. 1) install a backend 2) see it as an available option. > Actual behavior: > > - If user is logged in, > - If ILLOpacbackends is empty, returns all backends Correct, as is noted on the sys pref description: "If left empty, all installed backends will be enabled.". > - If ILLOpacbackends contains several values, return no backend What do you mean by 'several values' here? The syspref expects backend names separated by '|'. If the value of this sys pref does not match any backend name, none are returned. If, however, we have say Standard, BackendA and BackendB installed, we can set the sys pref as 'Standard|BackendA' and BackendB won't show as an OPAC option. > As the Standard backend is always available, it will be enabled by default > in OPAC, and needs to be disabled by setting ILLOpacbackends to something > that isn't a substring of "Standard". In this instance, if you have say Standard and Libris backends installed, and don't want to provide Standard as an option, then having ILLOpacbackends = 'Libris' would only show Libris as the OPAC backend. If, however, your requirement is to have the ILLModule only on the Staff client, and not have it on the OPAC at all, I think that's a different discussion/enhancement. This syspref in particular has quite a bit of test coverage: prove ./t/db_dependent/Koha/ILL/Request/Config.t Please let me know if the above helps or if I misunderstood the issue. (In reply to Pedro Amorim from comment #1) > Hi Andreas, I believe the behavior you describe is the functionality working > as designed. > > (In reply to Andreas Jonsson from comment #0) > > Expected behavior: > > > > - If user is logged, return list of backends that are 1) installed and 2) > > listed in ILLOpacbackends > > This would imply having to update the sys pref everytime a backend is > installed/uninstalled. I believe the way it's designed (e.g. show all if > left empty) is to ensure that Koha systems not using this sys pref get all > backends by default, which is what one would expect i.e. 1) install a > backend 2) see it as an available option. > > > Actual behavior: > > > > - If user is logged in, > > - If ILLOpacbackends is empty, returns all backends > > Correct, as is noted on the sys pref description: "If left empty, all > installed backends will be enabled.". > > > - If ILLOpacbackends contains several values, return no backend > > What do you mean by 'several values' here? The syspref expects backend names > separated by '|'. If the value of this sys pref does not match any backend > name, none are returned. If, however, we have say Standard, BackendA and > BackendB installed, we can set the sys pref as 'Standard|BackendA' and > BackendB won't show as an OPAC option. > > > As the Standard backend is always available, it will be enabled by default > > in OPAC, and needs to be disabled by setting ILLOpacbackends to something > > that isn't a substring of "Standard". > > In this instance, if you have say Standard and Libris backends installed, > and don't want to provide Standard as an option, then having ILLOpacbackends > = 'Libris' would only show Libris as the OPAC backend. > > If, however, your requirement is to have the ILLModule only on the Staff > client, and not have it on the OPAC at all, I think that's a different > discussion/enhancement. > > This syspref in particular has quite a bit of test coverage: > prove ./t/db_dependent/Koha/ILL/Request/Config.t > > Please let me know if the above helps or if I misunderstood the issue. I believe that making an ILL-backend available from the OPAC is a decision that libraries might want to make explicitly. So even if it is document that empty means "all" it is not necessarily what is expected. Particularly, since the Standard backend is now bundled by default it came as a surprise that it was available from the OPAC per default. I was reacting to the fact that the system preference is treated as one value, not a list. But since it is actually used as a regexp separating values with | would kind of work, although surely there are other unexpected consequences of this implementation, not least the usual security concerns of using user input as Perl regexps. |