Commit efa03357 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

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
parent dcca89e5
...@@ -21,7 +21,6 @@ package Bugzilla::WebService::Bugzilla; ...@@ -21,7 +21,6 @@ package Bugzilla::WebService::Bugzilla;
use strict; use strict;
use base qw(Bugzilla::WebService); use base qw(Bugzilla::WebService);
use Bugzilla::Constants; use Bugzilla::Constants;
use Bugzilla::Hook;
use DateTime; use DateTime;
...@@ -38,15 +37,14 @@ sub version { ...@@ -38,15 +37,14 @@ sub version {
sub extensions { sub extensions {
my $self = shift; my $self = shift;
my $extensions = Bugzilla::Hook::enabled_plugins();
foreach my $name (keys %$extensions) { my %retval;
my $info = $extensions->{$name}; foreach my $extension (@{ Bugzilla->extensions }) {
foreach my $data (keys %$info) { my $version = $extension->VERSION || 0;
$extensions->{$name}->{$data} = my $name = $extension->NAME;
$self->type('string', $info->{$data}); $retval{$name}->{version} = $self->type('string', $version);
}
} }
return { extensions => $extensions }; return { extensions => \%retval };
} }
sub timezone { sub timezone {
...@@ -135,10 +133,21 @@ in this Bugzilla. ...@@ -135,10 +133,21 @@ in this Bugzilla.
=item B<Returns> =item B<Returns>
A hash with a single item, C<extesions>. This points to a hash. I<That> hash A hash with a single item, C<extensions>. This points to a hash. I<That> hash
contains the names of extensions as keys, and information about the extension contains the names of extensions as keys, and the values are a hash.
as values. One of the values that must be returned is the 'version' of the That hash contains a single key C<version>, which is the version of the
extension 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> =item B<History>
...@@ -146,6 +155,10 @@ extension ...@@ -146,6 +155,10 @@ extension
=item Added in Bugzilla B<3.2>. =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
=back =back
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment