[bugzilla-gnome-org-extensions] 4.4 migration: Set correct urlbase for ajax calls



commit b6958833cacc8a56607801654b92a04ca02982e1
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Tue Nov 18 14:35:21 2014 +0100

    4.4 migration: Set correct urlbase for ajax calls
    
    This is to ensure that we use secure connection for them if Bugzilla
    is set up to use SSL.

 Extension.pm                                 |    2 +-
 lib/Ops.pm                                   |    6 ++++--
 template/en/default/pages/splinter.html.tmpl |    2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/Extension.pm b/Extension.pm
index 580f133..d143b5e 100644
--- a/Extension.pm
+++ b/Extension.pm
@@ -63,7 +63,7 @@ sub page_before_template {
     my $page = $args->{'page_id'};
     my $vars = $args->{'vars'};
 
-    maybe_get_statuses($page, $vars);
+    maybe_setup_vars_for_page($page, $vars);
 }
 
 sub webservice {
diff --git a/lib/Ops.pm b/lib/Ops.pm
index 8a71ad8..b77d6cd 100644
--- a/lib/Ops.pm
+++ b/lib/Ops.pm
@@ -29,11 +29,12 @@ our @EXPORT = qw(
     format_the_comment
     add_panel
     add_review_links_to_email
-    maybe_get_statuses
+    maybe_setup_vars_for_page
     add_dispatch
 );
 
 use Bugzilla::Extension::Splinter::Util;
+use Bugzilla::Util;
 
 sub _attachment_id_is_patch {
     my ($attach_id) = @_;
@@ -164,7 +165,7 @@ sub add_review_links_to_email {
     $email->body_set($body) if $new_body;
 }
 
-sub maybe_get_statuses {
+sub maybe_setup_vars_for_page {
     my ($page, $vars) = @_;
 
     if ($page eq 'splinter.html') {
@@ -178,6 +179,7 @@ sub maybe_get_statuses {
             @statuses = map { $_->name } @{ $field_object->legal_values };
         }
         $vars->{'attachment_statuses'} = \ statuses;
+        $vars->{'urlbase'} = correct_urlbase();
     }
 }
 
diff --git a/template/en/default/pages/splinter.html.tmpl b/template/en/default/pages/splinter.html.tmpl
index 3716603..06961bb 100644
--- a/template/en/default/pages/splinter.html.tmpl
+++ b/template/en/default/pages/splinter.html.tmpl
@@ -35,7 +35,7 @@
   ];
 
   configBase = '[% Param('splinter_base') FILTER js %]';
-  configBugzillaUrl = '[% Param('urlbase') FILTER js %]';
+  configBugzillaUrl = '[% urlbase FILTER js %]';
   configHaveExtension = true;
   configHelp = 'page.cgi?id=splinter/help.html';
   configNote = '';


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]