Koha will still show public lists next to the logo in OPAC even when OpacPublic is disabled, i.e. patrons are required to login to access anything. This can be a privacy issue, since list names may contain things that are not meant to be public and are intended to been seen only by registered patrons. Also it is not useful anyway, as clicking on a list list name does not actually bring up that list and just shows the login form. The whole list tab should be hidden when OpacPublic is disabled and a user is not logged in.
Quick workaround I came up with. Works for me with Koha 22.11.10.000 Rosalie. This will only shows the lists when a user is logged in if opacpublic is set to false. --- /koha/src/masthead.inc 2023-10-25 23:02:01.538423660 +0200 +++ masthead.inc 2023-10-25 23:03:45.558420570 +0200 @@ -37,6 +37,7 @@ [% END %] <li class="divider-vertical"></li> [% IF ( Koha.Preference( 'virtualshelves' ) == 1 ) %] + [% IF (( Koha.Preference( 'opacpublic' ) == 0 ) && ( logged_in_user )) || ( Koha.Preference( 'opacpublic' )) %] <li class="nav-item dropdown"> <a href="/cgi-bin/koha/opac-shelves.pl" title="Show lists" class="nav-link dropdown-toggle" id="listsmenu" data-toggle="dropdown" role="button" aria-label="Show dropdown with detailed list information" aria-haspopup="true" aria-expanded="false" ><i class="fa fa-list fa-icon-black" aria-hidden="true"></i> <span class="listslabel">Lists</span> @@ -81,6 +82,7 @@ </div> <!-- / .dropdown-menu --> </li> <!-- / .nav-item.dropdown --> [% END # / IF virtualshelves %] + [% END %] </ul> <!-- / .navbar-nav --> [% IF Koha.Preference( 'opacuserlogin' ) == 1 || Koha.Preference( 'EnableOpacSearchHistory') || Koha.Preference( 'opaclanguagesdisplay' ) %]
Created attachment 159170 [details] [review] Bug 33244: Do not show lists in OPAC if OpacPublic is disabled This patch updates markup and CSS in the OPAC header so that the Cart and Lists controls don't appear when OpacPublic is disabled. The patch also moves the "Your cookies" link into the group of links with "Log in to your account" and "Search history." This makes the template logic a little simpler and also seems like a more logical grouping. To test, apply the patch and enable the CookieContent system preference. - View the OPAC with the OpacPublic system preference enabled. - If necessary, click the "Accept all cookies" button. - The "Your cookies" link should now appear in the header between the log-in link and the search history link. - Test the page at various browser widths to confirm that the header still responds well to changes. - Go back to system preferences in the staff client and change the OpacPublic system preference to "disabled." - Return to the OPAC and refresh the page. You should be redirected to the login page, and the Cart and Lists buttons should no longer appear in the header. - The links in the header for login and cookies should look correct at various browser widths.
*** Bug 30264 has been marked as a duplicate of this bug. ***
I'm not sure why these 2 unrelated changes are on the same bug report. I don't understand why only anonymous users see the "Your cookies" link, and why logged in users have to go into their account and look at "Consents". But I think that's an issue in master... so I'm not going to worry about it.
(In reply to David Cook from comment #4) > I'm not sure why these 2 unrelated changes are on the same bug report. Oh wait... I understand now. It is related because you're hiding the Cart and Lists. Yep yep yep. Gotcha. Makes sense. All good.
Created attachment 159188 [details] [review] Bug 33244: Do not show lists in OPAC if OpacPublic is disabled This patch updates markup and CSS in the OPAC header so that the Cart and Lists controls don't appear when OpacPublic is disabled. The patch also moves the "Your cookies" link into the group of links with "Log in to your account" and "Search history." This makes the template logic a little simpler and also seems like a more logical grouping. To test, apply the patch and enable the CookieContent system preference. - View the OPAC with the OpacPublic system preference enabled. - If necessary, click the "Accept all cookies" button. - The "Your cookies" link should now appear in the header between the log-in link and the search history link. - Test the page at various browser widths to confirm that the header still responds well to changes. - Go back to system preferences in the staff client and change the OpacPublic system preference to "disabled." - Return to the OPAC and refresh the page. You should be redirected to the login page, and the Cart and Lists buttons should no longer appear in the header. - The links in the header for login and cookies should look correct at various browser widths. Signed-off-by: David Cook <dcook@prosentient.com.au>
"Log in to your account" is now on the left, is that expected?
(In reply to Jonathan Druart from comment #7) > "Log in to your account" is now on the left, is that expected? The test plan should've said that you need to run "perl build-resources.PL" to re-generate the CSS. If you don't, it will appear on the left. But if you do run it, then "Log in to your account" is still on the right as expected.
(In reply to David Cook from comment #8) > (In reply to Jonathan Druart from comment #7) > > "Log in to your account" is now on the left, is that expected? > > The test plan should've said that you need to run "perl build-resources.PL" > to re-generate the CSS. I should've noted it when testing due to its absence. My bad.
I could have guessed...
Created attachment 159225 [details] [review] Bug 33244: Do not show lists in OPAC if OpacPublic is disabled This patch updates markup and CSS in the OPAC header so that the Cart and Lists controls don't appear when OpacPublic is disabled. The patch also moves the "Your cookies" link into the group of links with "Log in to your account" and "Search history." This makes the template logic a little simpler and also seems like a more logical grouping. To test, apply the patch and enable the CookieContent system preference. - View the OPAC with the OpacPublic system preference enabled. - If necessary, click the "Accept all cookies" button. - The "Your cookies" link should now appear in the header between the log-in link and the search history link. - Test the page at various browser widths to confirm that the header still responds well to changes. - Go back to system preferences in the staff client and change the OpacPublic system preference to "disabled." - Return to the OPAC and refresh the page. You should be redirected to the login page, and the Cart and Lists buttons should no longer appear in the header. - The links in the header for login and cookies should look correct at various browser widths. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Ideally we should redesign C4::Auth::get_template_and_user to not pass the lists in this case. But... well... you know... :D
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.01
Merge conflicts with 23.05.x, no backport. If needed please rebase.
Hello, this patch seems to have a side effect of the "Language" dropdown now being awkwardly placed on center-right (regardless of whether user is logged in our out). This is caused by the below CSS rules whose blame traces back to this patch, and removing them fixes the issue. #members { + flex-grow: 1; + justify-content: flex-end; Is this intentional change? I can only assume it's not, since I don't see any mention of this in the discussion. Screenshots of the problem: https://imgur.com/a/hDZvn7B It looks like this patch conditionally hides cart+lists. The CSS above then makes only language shown on the left, and the login on the right. But when things aren't hidden, it changes the original position. Should I create a new bug about this?
(In reply to M from comment #16) > Should I create a new bug about this? Yep. Create a new bug and have it depend on this one.
(In reply to David Cook from comment #17) > (In reply to M from comment #16) > > Should I create a new bug about this? > > Yep. Create a new bug and have it depend on this one. Filed as: Bug 36337 - Hiding lists with OpacPublic breaks styling for language list