Bug 14004: Set the syspref's value to an empty string
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 27 Jan 2021 11:03:33 +0000 (12:03 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 27 Jan 2021 13:36:26 +0000 (14:36 +0100)
It's tested with "defined" in C4::Context->preference

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Auth.pm

index 5e44bd1..f4e0b90 100644 (file)
@@ -442,11 +442,21 @@ 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( OpacAdditionalStylesheet opaclayoutstylesheet intranetcolorstylesheet intranetstylesheet ) ) {
-        $ENV{"OVERRIDE_SYSPREF_$syspref"} = 0 if $in->{'query'}->param("DISABLE_SYSPREF_$syspref");
+    foreach my $syspref (
+        qw(
+            OPACUserCSS
+            OPACUserJS
+            IntranetUserCSS
+            IntranetUserJS
+            OpacAdditionalStylesheet
+            opaclayoutstylesheet
+            intranetcolorstylesheet
+            intranetstylesheet
+        )
+      )
+    {
+        $ENV{"OVERRIDE_SYSPREF_$syspref"} = q{}
+          if $in->{'query'}->param("DISABLE_SYSPREF_$syspref");
     }
 
     # Anonymous opac search history