Bug 16813: Allow empty string for OPACBaseURL
The pref is prefixed by 'http://', but it should not when the pref is
set to an empty string.
This will fix the bug raised on bug 14790 comment 14.
Test plan:
Empty OPACBaseURL and confirm that it's save as it in DB
Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
OPACBaseURL is saved up empty. Prefix http:// is not saved anymore
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit e9b6a5e31e)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
This commit is contained in:
parent
5de1b336da
commit
4fa7e90b0e
|
|
@ -615,7 +615,7 @@ sub set_preference {
|
|||
$value = 0 if ( $type && $type eq 'YesNo' && $value eq '' );
|
||||
|
||||
# force explicit protocol on OPACBaseURL
|
||||
if ( $variable eq 'opacbaseurl' && substr( $value, 0, 4 ) !~ /http/ ) {
|
||||
if ( $variable eq 'opacbaseurl' && $value && substr( $value, 0, 4 ) !~ /http/ ) {
|
||||
$value = 'http://' . $value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ C4::Context->clear_syspref_cache();
|
|||
$OPACBaseURL = C4::Context->preference('OPACBaseURL');
|
||||
is($OPACBaseURL,'http://junk2','OPACBaseURL saved with http:// as specified');
|
||||
|
||||
C4::Context->set_preference('OPACBaseURL', '');
|
||||
$OPACBaseURL = C4::Context->preference('OPACBaseURL');
|
||||
is($OPACBaseURL,'','OPACBaseURL saved empty as specified');
|
||||
|
||||
C4::Context->set_preference('SillyPreference','random');
|
||||
C4::Context->clear_syspref_cache();
|
||||
my $SillyPeference = C4::Context->preference('SillyPreference');
|
||||
|
|
|
|||
Loading…
Reference in New Issue