Description
David Cook
2022-11-15 01:22:10 UTC
Created attachment 143889 [details] [review] Bug 32205: Remove unnecessary syspref template params for failed OPAC auth This patch removes some unnecessary syspref template params for failed OPAC auth. The templates handle these syspref using the Koha.Preference() TT plugin function, so they're completely redundant and just make checkauth() longer than it needs to be. Test plan: 1) Apply patch 2) Enable OpacCloud, OpacBrowser, and OpacTopissue sysprefs 3) koha-plack --restart kohadev 4) Log out of Koha if you're logged in 5) Go to http://localhost:8080/cgi-bin/koha/opac-user.pl 6) Note that you can see the Cart as well as links for the following: Browse by hierarchy, Authority search, Tag cloud, Subject cloud, Most popular There are more sysprefs to remove (both for OPAC and staff interface), but I thought this was an easily manageable chunk. Ah I found a place where a preference is missing Koha.Preference() use. It is TagsEnabled at : koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt:[% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && TagsEnabled && TagsInputOnList ) %] (In reply to Fridolin Somers from comment #3) > Ah I found a place where a preference is missing Koha.Preference() use. > It is TagsEnabled at : > > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt:[% SET > TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && > TagsEnabled && TagsInputOnList ) %] It gets fetched in opac/opac-basket.pl using C4::Context->preference('TagsEnabled') and then passed to the template as TagsEnabled. (In reply to David Cook from comment #4) > (In reply to Fridolin Somers from comment #3) > > Ah I found a place where a preference is missing Koha.Preference() use. > > It is TagsEnabled at : > > > > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt:[% SET > > TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && > > TagsEnabled && TagsInputOnList ) %] > > It gets fetched in opac/opac-basket.pl using > C4::Context->preference('TagsEnabled') and then passed to the template as > TagsEnabled. OK great so we ignore it ;) Created attachment 144827 [details] [review] Bug 32205: Remove unnecessary syspref template params for failed OPAC auth This patch removes some unnecessary syspref template params for failed OPAC auth. The templates handle these syspref using the Koha.Preference() TT plugin function, so they're completely redundant and just make checkauth() longer than it needs to be. Test plan: 1) Apply patch 2) Enable OpacCloud, OpacBrowser, and OpacTopissue sysprefs 3) koha-plack --restart kohadev 4) Log out of Koha if you're logged in 5) Go to http://localhost:8080/cgi-bin/koha/opac-user.pl 6) Note that you can see the Cart as well as links for the following: Browse by hierarchy, Authority search, Tag cloud, Subject cloud, Most popular Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Created attachment 146446 [details] [review] Bug 32205: Remove unnecessary syspref template params for failed OPAC auth This patch removes some unnecessary syspref template params for failed OPAC auth. The templates handle these syspref using the Koha.Preference() TT plugin function, so they're completely redundant and just make checkauth() longer than it needs to be. Test plan: 1) Apply patch 2) Enable OpacCloud, OpacBrowser, and OpacTopissue sysprefs 3) koha-plack --restart kohadev 4) Log out of Koha if you're logged in 5) Go to http://localhost:8080/cgi-bin/koha/opac-user.pl 6) Note that you can see the Cart as well as links for the following: Browse by hierarchy, Authority search, Tag cloud, Subject cloud, Most popular Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com> Created attachment 147201 [details] [review] Bug 32205: Remove unnecessary syspref template params for failed OPAC auth This patch removes some unnecessary syspref template params for failed OPAC auth. The templates handle these syspref using the Koha.Preference() TT plugin function, so they're completely redundant and just make checkauth() longer than it needs to be. Test plan: 1) Apply patch 2) Enable OpacCloud, OpacBrowser, and OpacTopissue sysprefs 3) koha-plack --restart kohadev 4) Log out of Koha if you're logged in 5) Go to http://localhost:8080/cgi-bin/koha/opac-user.pl 6) Note that you can see the Cart as well as links for the following: Browse by hierarchy, Authority search, Tag cloud, Subject cloud, Most popular Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> An ideal solution would have been to remove them all ;) (In reply to Jonathan Druart from comment #9) > An ideal solution would have been to remove them all ;) Someday... Pushed to master for 23.05. Nice work everyone, thanks! Nice work everyone! Pushed to stable for 22.11.x Backported to 22.05.x for upcoming 22.05.11 applied to 21.11 for 21.11.19 Not backported to 21.05.x |