Summary: | Add ability to temporarily disable added CSS and Javascript in OPAC and interface | ||
---|---|---|---|
Product: | Koha | Reporter: | Barton Chittenden <barton> |
Component: | Staff interface | Assignee: | Fridolin Somers <fridolin.somers> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | andrew, fridolin.somers, gmcharlt, jonathan.druart, lucas, victor |
Version: | unspecified | Keywords: | Manual |
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This allows to temporarily disable any of OPACUserCSS, OPACUserJS, OpacAdditionalStylesheet, opaclayoutstylesheet, IntranetUserCSS, IntranetUserJS, intranetcolorstylesheet, and intranetstylesheet system preference via an URL parameter.
Alter the URL in OPAC or staff interface by adding an additional parameter DISABLE_SYSPREF_<system preference name>=1.
Example:
/cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_IntranetUserCSS=1
|
Version(s) released in: |
21.05.00,20.11.03,20.05.09
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 28583 | ||
Attachments: |
Bug 14004: Add ability to temporarily disable JS/CSS sysprefs
Bug 14004: Add ability to temporarily disable JS/CSS sysprefs Bug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet Bug 14004: Add ability to temporarily disable JS/CSS sysprefs Bug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet Bug 14004: Add ability to temporarily disable JS/CSS sysprefs Bug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet Bug 14004: Set the syspref's value to an empty string Bug 14004: Set the syspref's value to an empty string Bug 14004: Set the syspref's value to an empty string Bug 14004: Set the syspref's value to an empty string |
Description
Barton Chittenden
2015-04-16 14:31:28 UTC
Actually, it would be even nicer if this could be handled via an option in the URL, eg. .../cgi-bin/koha/catalogue/itemsearch.pl?disbable_intranetuserjs=true Created attachment 115064 [details] [review] 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. Note that this only works for 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 Nice! This works well and its a great way to troubleshoot potential problems. Created attachment 115120 [details] [review] 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. Note that this only works for 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 Hi Frido, could we please add OpacAdditionalStylesheet and opaclayoutstylesheet to this to make the same options available for staff and intranet? Created attachment 115567 [details] [review] Bug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet Created attachment 115583 [details] [review] 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> Created attachment 115584 [details] [review] Bug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet Signed-off-by: Owen Leonard <oleonard@myacpl.org> In case it helps, here are the links I tested: /cgi-bin/koha/opac-main.pl?DISABLE_SYSPREF_OPACUserCSS=1 /cgi-bin/koha/opac-main.pl?DISABLE_SYSPREF_OPACUserJS=1 /cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_IntranetUserCSS=1 /cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_IntranetUserJS=1 /cgi-bin/koha/opac-main.pl?DISABLE_SYSPREF_OpacAdditionalStylesheet=1 /cgi-bin/koha/opac-main.pl?DISABLE_SYSPREF_opaclayoutstylesheet=1 /cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_intranetcolorstylesheet=1 /cgi-bin/koha/mainpage.pl?DISABLE_SYSPREF_intranetstylesheet=1 I also tested some doubling them up, e.g. /cgi-bin/koha/opac-main.pl?DISABLE_SYSPREF_opaclayoutstylesheet=1&DISABLE_SYSPREF_OPACUserJS=1 I am going to pass this. One idea for future improvement: make the syspref spelling case-insensitive! Created attachment 115589 [details] [review] 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> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 115590 [details] [review] Bug 14004: Add OpacAdditionalStylesheet and opaclayoutstylesheet Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Why setting the env vars to 0 and " "? I am expecting to have them set to an empty string. Created attachment 115871 [details] [review] Bug 14004: Set the syspref's value to an empty string It's tested with "defined" in C4::Context->preference Created attachment 115874 [details] [review] Bug 14004: Set the syspref's value to an empty string It's tested with "defined" in C4::Context->preference Created attachment 115876 [details] [review] Bug 14004: Set the syspref's value to an empty string It's tested with "defined" in C4::Context->preference Created attachment 115883 [details] [review] Bug 14004: Set the syspref's value to an empty string It's tested with "defined" in C4::Context->preference Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Pushed to master for 21.05, thanks to everybody involved! Small but very usefull feature, I choose to backport. Pushed to 20.11.x for 20.11.03 Small and useful and really no way someone's going to bump into it on accident. Backporting to 20.05.x for 20.05.09. > Small and useful and really no way someone's going to bump into it on accident.
Indeed !
Backported: Pushed to 19.11.x branch for 19.11.15
|