Closed
Bug 544506
Opened 14 years ago
Closed 14 years ago
Bugzilla->input_params is undefined when calling Bugzilla.version and other methods taking no argument
Categories
(Bugzilla :: WebService, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: LpSolit, Assigned: LpSolit)
Details
(Keywords: regression)
Attachments
(1 file)
630 bytes,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
When you call Bugzilla.version, you don't pass any other argument. Consequently, $som->paramsin in Bugzilla::XMLRPC::Deserializer->deserialize() is undefined and so Bugzilla->input_params is not set, making subsequent calls to Bugzilla->input_params->{foo} to die with # Can't use string ("") as a HASH ref while "strict refs" in use at Bugzilla/WebService/Server.pm line 24. So if no parameters are passed, we should set Bugzilla->input_params to {} to avoid extra checks everywhere in the code. This problem was found while running the webservice_bugzilla.t QA test script, see http://landfill.bugzilla.org/bugzillaqa/show_bug.cgi?id=3161
Flags: blocking3.6+
Attachment #425483 -
Flags: review?(mkanat)
Comment 1•14 years ago
|
||
Maybe something like this? === modified file 'Bugzilla.pm' --- Bugzilla.pm 2009-11-24 06:09:41 +0000 +++ Bugzilla.pm 2010-02-05 18:54:27 +0000 @@ -263,7 +263,7 @@ # Making this scalar makes it a tied hash to the internals of $cgi, # so if a variable is changed, then it actually changes the $cgi object # as well. - $cache->{input_params} = $class->cgi->Vars; + $cache->{input_params} = $class->cgi->Vars ? $class->cgi->Vars : {}; return $cache->{input_params}; }
Comment 2•14 years ago
|
||
Comment on attachment 425483 [details] [diff] [review] patch, v1 Awesome. Does this affect the JSON-RPC interface too, or just XML-RPC?
Attachment #425483 -
Flags: review?(mkanat) → review+
Updated•14 years ago
|
Flags: approval3.6+
Flags: approval+
Assignee | ||
Comment 3•14 years ago
|
||
(In reply to comment #2) > Awesome. Does this affect the JSON-RPC interface too, or just XML-RPC? By looking at the source code of JSON::RPC::Server->_argument_type_check(), it seems to always return something defined, so I think XML-RPC only.
Assignee | ||
Comment 4•14 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/ modified Bugzilla/WebService/Server/XMLRPC.pm Committed revision 6962. Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.6/ modified Bugzilla/WebService/Server/XMLRPC.pm Committed revision 6957.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•14 years ago
|
||
(In reply to comment #1) > Maybe something like this? dkl: I'm not sure about side effects this could have. JSON-RPC is not supposed to have this problem, and CGI scripts aren't either, so fixing this here may hide real unexpected bugs in the future, so maybe it's safer to fix it the way I did.
You need to log in
before you can comment on or make changes to this bug.
Description
•