Bug 13967: (RM followup) fix merge error
authorTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 4 Jun 2015 18:15:32 +0000 (15:15 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 4 Jun 2015 18:15:32 +0000 (15:15 -0300)
When I merged 13967 into master (with 5010 already on it) I inadvertedly
removed a few lines that add a check for bad OPACBaseURL values.

While I don't agree with that check it should be discussed on a separate
bug anyway.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Context.pm

index 188a7ba..099ddaf 100644 (file)
@@ -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();
     }