Bugzilla – Attachment 115583 Details for
Bug 14004
Add ability to temporarily disable added CSS and Javascript in OPAC and interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14004: Add ability to temporarily disable JS/CSS sysprefs
Bug-14004-Add-ability-to-temporarily-disable-JSCSS.patch (text/plain), 2.05 KB, created by
Owen Leonard
on 2021-01-21 18:04:21 UTC
(
hide
)
Description:
Bug 14004: Add ability to temporarily disable JS/CSS sysprefs
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-01-21 18:04:21 UTC
Size:
2.05 KB
patch
obsolete
>From 3bde72fb494392a1b421a38fb42eecdb84ed96e4 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 12 Jan 2021 11:15:25 +0100 >Subject: [PATCH] Bug 14004: Add ability to temporarily disable JS/CSS sysprefs > >It would be *super* handy if intranetuserjs and/or opacuserjs could be >temporarily disabled via a check-box or syspref. >Right now, debugging issues in intranetuserjs usuaally starts with >copying the contents into a text file, blanking the syspref and re-testing. > >This patch adds this feature by setting syspref via ENV >OVERRIDE_SYSPREF like override via Apache config. > >Implemented only for preferences : >OPACUserCSS OPACUserJS IntranetUserCSS IntranetUserJS >=> replaced with ' ' >intranetcolorstylesheet intranetstylesheet >=> replaced with 0 > >Test plan : >1) Set some CSS in IntranetUserCSS like : #breadcrumbs{color:red} >2) Go to staff interface home page like : /cgi-bin/koha/mainpage.pl >3) See CSS impact is visible >4) Edit URL : /cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_IntranetUserCSS=1 >5) See CSS impact is not visible >6) Check with the other preferences > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Auth.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 10f0d9d3b7..cef3cb4755 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -440,6 +440,15 @@ sub get_template_and_user { > } > } > >+ # Sysprefs disabled via URL param >+ # Note that value must be defined in order to override via ENV >+ foreach my $syspref ( qw( OPACUserCSS OPACUserJS IntranetUserCSS IntranetUserJS ) ) { >+ $ENV{"OVERRIDE_SYSPREF_$syspref"} = q{ } if $in->{'query'}->param("DISABLE_SYSPREF_$syspref"); >+ } >+ foreach my $syspref ( qw( intranetcolorstylesheet intranetstylesheet ) ) { >+ $ENV{"OVERRIDE_SYSPREF_$syspref"} = 0 if $in->{'query'}->param("DISABLE_SYSPREF_$syspref"); >+ } >+ > # Anonymous opac search history > # If opac search history is enabled and at least one search has already been performed > if ( C4::Context->preference('EnableOpacSearchHistory') ) { >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14004
:
115064
|
115120
|
115567
|
115583
|
115584
|
115589
|
115590
|
115871
|
115874
|
115876
|
115883