From 4ac63bb2181e9e07851bf73520cd068818947b6a Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Wed, 6 Mar 2013 16:40:29 +0800 Subject: Bug 848217: The product component search field is not putting bugzilla.mozilla.org components before upstream Bugzilla components --- extensions/ProdCompSearch/Extension.pm | 7 +++++++ extensions/ProdCompSearch/lib/WebService.pm | 2 +- extensions/ProdCompSearch/web/js/prod_comp_search.js | 6 +++--- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'extensions/ProdCompSearch') diff --git a/extensions/ProdCompSearch/Extension.pm b/extensions/ProdCompSearch/Extension.pm index 4a4fae355..a5955fd8b 100644 --- a/extensions/ProdCompSearch/Extension.pm +++ b/extensions/ProdCompSearch/Extension.pm @@ -11,4 +11,11 @@ use base qw(Bugzilla::Extension); our $VERSION = '1'; +sub webservice { + my ($self, $args) = @_; + my $dispatch = $args->{dispatch}; + $dispatch->{PCS} = "Bugzilla::Extension::ProdCompSearch::WebService"; +} + + __PACKAGE__->NAME; diff --git a/extensions/ProdCompSearch/lib/WebService.pm b/extensions/ProdCompSearch/lib/WebService.pm index bbc355e00..dea2e5e51 100644 --- a/extensions/ProdCompSearch/lib/WebService.pm +++ b/extensions/ProdCompSearch/lib/WebService.pm @@ -22,7 +22,7 @@ sub prod_comp_search { my $search = $params->{'search'}; $search || ThrowCodeError('param_required', - { function => 'Bug.prod_comp_search', param => 'search' }); + { function => 'PCS.prod_comp_search', param => 'search' }); my $limit = detaint_natural($params->{'limit'}) ? $dbh->sql_limit($params->{'limit'}) diff --git a/extensions/ProdCompSearch/web/js/prod_comp_search.js b/extensions/ProdCompSearch/web/js/prod_comp_search.js index 1aa65d5e6..f58a8d330 100644 --- a/extensions/ProdCompSearch/web/js/prod_comp_search.js +++ b/extensions/ProdCompSearch/web/js/prod_comp_search.js @@ -24,7 +24,7 @@ YUI({ autoComplete = null; var resultListFormat = function(query, results) { - return Y.Array.map(results, function (result) { + return Y.Array.map(results, function(result) { var data = result.raw; result.text = data.product + ' :: ' + data.component; return Y.Escape.html(result.text); @@ -35,7 +35,7 @@ YUI({ counter = counter + 1; var json_object = { version: "1.1", - method : "MyDashboard.prod_comp_search", + method : "PCS.prod_comp_search", id : counter, params : { search: query } }; @@ -99,7 +99,7 @@ YUI({ } window.location.href = url; } - }, + } }); input.on('focus', function (e) { -- cgit v1.2.3-24-g4f1b