diff --git a/C4/Context.pm b/C4/Context.pm index 188a7ba27e..099ddaf6e6 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -604,6 +604,11 @@ sub set_preference { $value = 0 if ( $type && $type eq 'YesNo' && $value eq '' ); + # force explicit protocol on OPACBaseURL + if ($var eq 'opacbaseurl' && substr($value,0,4) !~ /http/) { + $value = 'http://' . $value; + } + if ($syspref) { $syspref = $syspref->set( { value => $value } )->store(); }