From d12c28a351ddcc63186c59e1403ead046bf36e2b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 27 Jan 2021 12:03:33 +0100 Subject: [PATCH] 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 Signed-off-by: Jonathan Druart (cherry picked from commit 6b23c0634b43a60f0a434d4c43a3e57718ad0806) Signed-off-by: Fridolin Somers (cherry picked from commit efdf8bb303d0fd37a80150f41193b34173e23d3f) Signed-off-by: Andrew Fuerste-Henry (cherry picked from commit 1ec05c1c3225c9baaec2011831dc6f69fc94caac) Signed-off-by: Victor Grousset/tuxayo --- C4/Auth.pm | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 83523a6e4c..22ea87d4d7 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -435,11 +435,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 -- 2.39.5