aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-12-17 21:51:41 +0000
committermkanat%bugzilla.org <>2009-12-17 21:51:41 +0000
commitefa03357139f331e05e1ace0928447d06867f5d3 (patch)
tree9e57c3022c0b0185068fa89f43dbcdc4d08665ed /Bugzilla/WebService
parentdcca89e5e6ba556f8dc61bc5337434158f2adbad (diff)
downloadbugs-efa03357139f331e05e1ace0928447d06867f5d3.tar
bugs-efa03357139f331e05e1ace0928447d06867f5d3.tar.gz
bugs-efa03357139f331e05e1ace0928447d06867f5d3.tar.bz2
bugs-efa03357139f331e05e1ace0928447d06867f5d3.tar.xz
bugs-efa03357139f331e05e1ace0928447d06867f5d3.zip
Bug 531119: Fix the Bugzilla.extensions WebService method to work with the new Extensions system.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=dkl, a=mkanat
Diffstat (limited to 'Bugzilla/WebService')
-rw-r--r--[-rwxr-xr-x]Bugzilla/WebService/Bugzilla.pm39
1 files changed, 26 insertions, 13 deletions
diff --git a/Bugzilla/WebService/Bugzilla.pm b/Bugzilla/WebService/Bugzilla.pm
index b1ab8f34f..6e74900b9 100755..100644
--- a/Bugzilla/WebService/Bugzilla.pm
+++ b/Bugzilla/WebService/Bugzilla.pm
@@ -21,7 +21,6 @@ package Bugzilla::WebService::Bugzilla;
use strict;
use base qw(Bugzilla::WebService);
use Bugzilla::Constants;
-use Bugzilla::Hook;
use DateTime;
@@ -38,15 +37,14 @@ sub version {
sub extensions {
my $self = shift;
- my $extensions = Bugzilla::Hook::enabled_plugins();
- foreach my $name (keys %$extensions) {
- my $info = $extensions->{$name};
- foreach my $data (keys %$info) {
- $extensions->{$name}->{$data} =
- $self->type('string', $info->{$data});
- }
+
+ my %retval;
+ foreach my $extension (@{ Bugzilla->extensions }) {
+ my $version = $extension->VERSION || 0;
+ my $name = $extension->NAME;
+ $retval{$name}->{version} = $self->type('string', $version);
}
- return { extensions => $extensions };
+ return { extensions => \%retval };
}
sub timezone {
@@ -135,10 +133,21 @@ in this Bugzilla.
=item B<Returns>
-A hash with a single item, C<extesions>. This points to a hash. I<That> hash
-contains the names of extensions as keys, and information about the extension
-as values. One of the values that must be returned is the 'version' of the
-extension
+A hash with a single item, C<extensions>. This points to a hash. I<That> hash
+contains the names of extensions as keys, and the values are a hash.
+That hash contains a single key C<version>, which is the version of the
+extension, or C<0> if the extension hasn't defined a version.
+
+The return value looks something like this:
+
+ extensions => {
+ Example => {
+ version => '3.6',
+ },
+ BmpConvert => {
+ version => '1.0',
+ },
+ }
=item B<History>
@@ -146,6 +155,10 @@ extension
=item Added in Bugzilla B<3.2>.
+=item As of Bugzilla B<3.6>, the names of extensions are canonical names
+that the extensions define themselves. Before 3.6, the names of the
+extensions depended on the directory they were in on the Bugzilla server.
+
=back
=back