]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1153125: bug 1051056 causes "Constant subroutine redefined" warnings during t...
authorDavid Lawrence <dkl@mozilla.com>
Mon, 13 Apr 2015 13:59:31 +0000 (14:59 +0100)
committerDavid Lawrence <dkl@mozilla.com>
Mon, 13 Apr 2015 13:59:31 +0000 (14:59 +0100)
r=LpSolit,a=glob

Bugzilla/API/1_0/Constants.pm
Bugzilla/API/1_0/Resource/Bug.pm
Bugzilla/API/1_0/Resource/Component.pm
Bugzilla/API/1_0/Resource/FlagType.pm
Bugzilla/API/1_0/Resource/Group.pm
Bugzilla/API/1_0/Resource/Product.pm
Bugzilla/API/1_0/Resource/User.pm
Bugzilla/API/1_0/Server.pm
Bugzilla/API/1_0/Util.pm
Bugzilla/API/Server.pm

index caf670c7bc2485732b09b297a953984ce8af30b3..44e20124ad82048036afbb6f747e44439f4f45c7 100644 (file)
@@ -15,7 +15,7 @@ use Bugzilla::Hook;
 
 use parent qw(Exporter);
 
-our @EXPORT = qw(
+our @EXPORT_OK = qw(
     WS_ERROR_CODE
 
     STATUS_OK
index c61b2c6c2928ffde8aaf384d11a14e4e63a6fd21..8bdf9ae2da92c00c82fa66539a367918fe9eed4b 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
 use Bugzilla::API::1_0::Util;
 
 use Bugzilla::Comment;
index c3bdc0386796882b06f0d0b3dee9390563d36c58..96c2a3dcdc09ba5f65943b43c25f071d7e7d986e 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
 use Bugzilla::API::1_0::Util;
 
 use Bugzilla::Component;
index 297be1510c869bf590988c898a7a05090538edb5..702b4d4ec7c082cdbb0f44111a91737db7ba89f4 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
 use Bugzilla::API::1_0::Util;
 
 use Bugzilla::Component;
index aee8a74925921e5c6e77cd8406bf48339447280b..4efd7b476bd5c6f7ea554cc5a7eb262da8a7ac6b 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
 use Bugzilla::API::1_0::Util;
 
 use Bugzilla::Constants;
index 0f393e2073d52c9bc696e3c3392a10b8a028aa5c..dcd4b9a684069383e3931be6eac976d6568df153 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
 use Bugzilla::API::1_0::Util;
 
 use Bugzilla::Product;
index d2c8699073b01038f5464ba82ec69041f5a44644..8b4e99e2ecad7b5dbbdb4d63273887778f85a411 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(STATUS_CREATED);
 use Bugzilla::API::1_0::Util;
 
 use Bugzilla::Constants;
index 108c25e274c677b901e937eaff15d7f5aa3e65b9..83d09c401fa8d3301a52f473e51f38a6187b5353 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(API_AUTH_HEADERS);
 use Bugzilla::API::1_0::Util qw(taint_data fix_credentials api_include_exclude);
 
 use Bugzilla::Constants;
index 2d83e1d2d2c05cf7b1b5ff834a609a5da04ff141..d22935f6eb429545e34132c5b954cefff22382b0 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use Bugzilla::API::1_0::Constants;
+use Bugzilla::API::1_0::Constants qw(API_AUTH_HEADERS);
 use Bugzilla::Error;
 use Bugzilla::Flag;
 use Bugzilla::FlagType;
index 439f6e743634db9d86286a2896780dd997664633..496901037807266786b023603706a7b8478bdf0e 100644 (file)
@@ -95,25 +95,26 @@ sub server {
 
 sub constants {
     my ($self) = @_;
-    my $api_version = $self->api_version;
+    return $self->{_constants} if defined $self->{_constants};
 
     no strict 'refs';
 
+    my $api_version = $self->api_version;
     my $class = "Bugzilla::API::${api_version}::Constants";
     require_module($class);
 
-    my %constants;
-    foreach my $constant (@{$class . "::EXPORT"}, @{$class . "::EXPORT_OK"}) {
+    $self->{_constants} = {};
+    foreach my $constant (@{$class . "::EXPORT_OK"}) {
         if (ref $class->$constant) {
-            $constants{$constant} = $class->$constant;
+            $self->{_constants}->{$constant} = $class->$constant;
         }
         else {
             my @list = ($class->$constant);
-            $constants{$constant} = (scalar(@list) == 1) ? $list[0] : \@list;
+            $self->{_constants}->{$constant} = (scalar(@list) == 1) ? $list[0] : \@list;
         }
     }
 
-    return \%constants;
+    return $self->{_constants};
 }
 
 sub response_header {