Bug 30873 - "Libraries" link on OPAC should be hideable by system preference
Summary: "Libraries" link on OPAC should be hideable by system preference
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement with 10 votes (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 13388
Blocks: 36742
  Show dependency treegraph
 
Reported: 2022-06-01 02:30 UTC by David Cook
Modified: 2024-07-02 15:22 UTC (History)
4 users (show)

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


Attachments
Bug 30873: Add system preference to hide libraries link in the OPAC (6.50 KB, patch)
2024-06-27 18:55 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30873: Add system preference to hide libraries link in the OPAC (9.88 KB, patch)
2024-06-28 11:04 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30873: Add system preference to hide libraries link in the OPAC (6.50 KB, patch)
2024-06-28 11:47 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30873: Add system preference to hide libraries link in the OPAC (6.56 KB, patch)
2024-06-28 14:40 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 30873: Add system preference to hide libraries link in the OPAC (6.66 KB, patch)
2024-07-02 11:44 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2022-06-01 02:30:44 UTC
Most of my libraries don't want to show the "Libraries" link on the OPAC. 

While you can hide it using Javascript, it's not a very elegant solution. There should be a system preference to hide it (like every other option on that nav bar besides "Advanced search").
Comment 1 Caroline Cyr La Rose 2024-04-19 14:26:09 UTC
I agree. It was a nightmare when we upgraded to that version, all my clients were unhappy with the change for some reason (and very vocal about it). They have gotten used to it since, fortunately, although if this goes through, I'm sure a lot of them will disable it. Adding this type of thing should definitely come with a syspref.
Comment 2 Owen Leonard 2024-06-26 15:47:26 UTC
Would it suffice to hide the "Libraries" link in the OPAC when there are no libraries set to "public?" We should definitely do that, but does it fulfill the need described in this bug?
Comment 3 David Cook 2024-06-26 23:08:26 UTC
(In reply to Owen Leonard from comment #2)
> Would it suffice to hide the "Libraries" link in the OPAC when there are no
> libraries set to "public?" We should definitely do that, but does it fulfill
> the need described in this bug?

No, for this one we just need to hide it completely. Most of my libraries don't want the link there at all.
Comment 4 Caroline Cyr La Rose 2024-06-27 14:44:00 UTC
Like David said, I think there should be an on/off switch, plus if it's on hide if there are no "public" libraries.
Comment 5 Caroline Cyr La Rose 2024-06-27 18:23:13 UTC
Found Bug 36742 which addresses the presence of the link if there are no public libraries
Comment 6 Owen Leonard 2024-06-27 18:55:11 UTC
Created attachment 168210 [details] [review]
Bug 30873: Add system preference to hide libraries link in the OPAC

Some users would prefer that the libraries link not appear in the menu
of links under the OPAC's main search bar. This patch adds a preference
to do so.

The preference defaults to "On" since "On" is the current default
behavior.

To test, apply the patch and run the database update prcoess.

- In the OPAC, confirm that by default the "Libraries" link appears.
- In the staff interface, go to Administration -> System preferences ->
  OPACShowLibraries
- Set the preference to "Don't show"
- Return to the OPAC and confirm that the "Libraries" link isn't there.
- Try to navigate directly to /cgi-bin/koha/opac-library.pl. You should
  be redirected to a 404 page.

Sponsored-by: Athens County Public Libraries
Comment 7 Phil Ringnalda (back in August) 2024-06-27 23:54:07 UTC
Minor nit: the comment in opac-library.pl says "OpacTopissue" rather than "OPACShowLibraries". But at least we know it's copied from working code!
Comment 8 David Cook 2024-06-28 00:19:40 UTC
(In reply to Phil Ringnalda from comment #7)
> Minor nit: the comment in opac-library.pl says "OpacTopissue" rather than
> "OPACShowLibraries". But at least we know it's copied from working code!

Good spot. If you're going to sign this one off, feel free to add a patch to fix that. I'd be happy to QA both together.
Comment 9 Owen Leonard 2024-06-28 11:04:41 UTC
Created attachment 168231 [details] [review]
Bug 30873: Add system preference to hide libraries link in the OPAC

Some users would prefer that the libraries link not appear in the menu
of links under the OPAC's main search bar. This patch adds a preference
to do so.

The preference defaults to "On" since "On" is the current default
behavior.

To test, apply the patch and run the database update prcoess.

- In the OPAC, confirm that by default the "Libraries" link appears.
- In the staff interface, go to Administration -> System preferences ->
  OPACShowLibraries
- Set the preference to "Don't show"
- Return to the OPAC and confirm that the "Libraries" link isn't there.
- Try to navigate directly to /cgi-bin/koha/opac-library.pl. You should
  be redirected to a 404 page.

Sponsored-by: Athens County Public Libraries
Comment 10 Owen Leonard 2024-06-28 11:47:01 UTC
Created attachment 168233 [details] [review]
Bug 30873: Add system preference to hide libraries link in the OPAC

Some users would prefer that the libraries link not appear in the menu
of links under the OPAC's main search bar. This patch adds a preference
to do so.

The preference defaults to "On" since "On" is the current default
behavior.

To test, apply the patch and run the database update prcoess.

- In the OPAC, confirm that by default the "Libraries" link appears.
- In the staff interface, go to Administration -> System preferences ->
  OPACShowLibraries
- Set the preference to "Don't show"
- Return to the OPAC and confirm that the "Libraries" link isn't there.
- Try to navigate directly to /cgi-bin/koha/opac-library.pl. You should
  be redirected to a 404 page.

Sponsored-by: Athens County Public Libraries
Comment 11 Caroline Cyr La Rose 2024-06-28 14:40:16 UTC
Created attachment 168250 [details] [review]
Bug 30873: Add system preference to hide libraries link in the OPAC

Some users would prefer that the libraries link not appear in the menu
of links under the OPAC's main search bar. This patch adds a preference
to do so.

The preference defaults to "On" since "On" is the current default
behavior.

To test, apply the patch and run the database update prcoess.

- In the OPAC, confirm that by default the "Libraries" link appears.
- In the staff interface, go to Administration -> System preferences ->
  OPACShowLibraries
- Set the preference to "Don't show"
- Return to the OPAC and confirm that the "Libraries" link isn't there.
- Try to navigate directly to /cgi-bin/koha/opac-library.pl. You should
  be redirected to a 404 page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 12 Marcel de Rooy 2024-07-02 11:44:44 UTC
Created attachment 168351 [details] [review]
Bug 30873: Add system preference to hide libraries link in the OPAC

Some users would prefer that the libraries link not appear in the menu
of links under the OPAC's main search bar. This patch adds a preference
to do so.

The preference defaults to "On" since "On" is the current default
behavior.

To test, apply the patch and run the database update prcoess.

- In the OPAC, confirm that by default the "Libraries" link appears.
- In the staff interface, go to Administration -> System preferences ->
  OPACShowLibraries
- Set the preference to "Don't show"
- Return to the OPAC and confirm that the "Libraries" link isn't there.
- Try to navigate directly to /cgi-bin/koha/opac-library.pl. You should
  be redirected to a 404 page.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Katrin Fischer 2024-07-02 14:34:34 UTC
I've seen this a few times recently, so noting here:
Please include a success line (say or say_success) in your database updates after the SQL has been run.
Comment 14 Katrin Fischer 2024-07-02 14:58:30 UTC
"options" is missing here from the parameter list of the new pref:

 ('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'),
+('OPACShowLibraries', '1', 'If enabled, a link is shown in the OPAC pointing to a page with library information', '', 'YesNo'),
 ('OPACShowMusicalInscripts','0','','Display musical inscripts on the OPAC record details page when available.','YesNo'),

Fixed.
Comment 15 Katrin Fischer 2024-07-02 15:22:14 UTC
Pushed for 24.11!

Well done everyone, thank you!