diff options
author | mkanat%bugzilla.org <> | 2009-10-24 05:21:06 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2009-10-24 05:21:06 +0000 |
commit | a2dd3b00284fd4724d3408274cb1156c7a77d187 (patch) | |
tree | 4aa41a1c8cea9d31aaccddc4685f8f1c5991c1b4 /jsonrpc.cgi | |
parent | Bug 365267: attachment.cgi should not be editable when the user is not logged... (diff) | |
download | bugzilla-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.gz bugzilla-a2dd3b00284fd4724d3408274cb1156c7a77d187.tar.bz2 bugzilla-a2dd3b00284fd4724d3408274cb1156c7a77d187.zip |
Bug 520948: Use Bugzilla->feature and feature_enabled everywhere instead of checking if modules are installed
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'jsonrpc.cgi')
-rwxr-xr-x[-rw-r--r--] | jsonrpc.cgi | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/jsonrpc.cgi b/jsonrpc.cgi index cd41663fa..25fb4c175 100644..100755 --- a/jsonrpc.cgi +++ b/jsonrpc.cgi @@ -27,10 +27,12 @@ use Bugzilla; use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::WebService::Constants; -# This eval allows runtests to pass even if JSON::RPC isn't -# installed. +if (!Bugzilla->feature('jsonrpc')) { + ThrowCodeError('feature_disabled', { feature => 'jsonrpc' }); +} + +# This eval allows runtests.pl to pass. eval { require Bugzilla::WebService::Server::JSONRPC; }; -$@ && ThrowCodeError('json_rpc_not_installed'); Bugzilla->usage_mode(USAGE_MODE_JSON); |