Closed
Bug 686904
Opened 13 years ago
Closed 13 years ago
Removing an invalid URL from the See Also field crashes Bugzilla
Categories
(Bugzilla :: WebService, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.2
People
(Reporter: LpSolit, Assigned: LpSolit)
References
Details
(Keywords: regression)
Attachments
(1 file)
901 bytes,
patch
|
timello
:
review+
|
Details | Diff | Splinter Review |
When webservice_bug_update_see_also.t passes
{ ids => ['public_bug'], remove => ['asdfasdfasdf'] }
to Bug.update_see_also, Bugzilla crashes with:
# Can't call method "isa" on an undefined value at Bugzilla/Bug.pm line 2892.
# at Bugzilla/Bug.pm line 2892
# Bugzilla::Bug::remove_see_also('Bugzilla::Bug=HASH(0x9f997a0)', 'asdfasdfasdf') called at Bugzilla/WebService/Bug.pm line 734
# Bugzilla::WebService::Bug::update_see_also('Bugzilla::WebService::Server::JSONRPC::Bugzilla::WebService::...', 'HASH(0x9ad85d8)') called at (eval 1059) line 1
# eval ' $procedure->{code}->($self, @params)
# ;' called at /usr/lib/perl5/vendor_perl/5.12.2/JSON/RPC/Server.pm line 220
# JSON::RPC::Server::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::WebService::...', 'HASH(0x9ad85b8)') called at Bugzilla/WebService/Server/JSONRPC.pm line 258
# Bugzilla::WebService::Server::JSONRPC::_handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::WebService::...', 'HASH(0x9ad85b8)') called at /usr/lib/perl5/vendor_perl/5.12.2/JSON/RPC/Server.pm line 126
# JSON::RPC::Server::handle('Bugzilla::WebService::Server::JSONRPC::Bugzilla::WebService::...') called at /var/www/html/bugzilla_qa42/jsonrpc.cgi line 41
Line 2892 in Bugzilla/Bug.pm is in remove_see_also():
if ($removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local')
This means $removed_bug_url is undefined. No idea if that's expected or not.
Flags: blocking4.2+
![]() |
Assignee | |
Comment 1•13 years ago
|
||
$removed_bug_url is undefined if the given URL wasn't in the See Also list. So we have to check for it existence first.
Comment 2•13 years ago
|
||
Comment on attachment 560721 [details] [diff] [review]
patch, v1
Review of attachment 560721 [details] [diff] [review]:
-----------------------------------------------------------------
::: Bugzilla/Bug.pm
@@ +2889,5 @@
> # Since we remove also the url from the referenced bug,
> # we need to notify changes for that bug too.
> $removed_bug_url = $removed_bug_url->[0];
> + if ($removed_bug_url
> + and $removed_bug_url->isa('Bugzilla::BugUrl::Bugzilla::Local')
Well, actually, I don't think we should silent ignore invalid URL when trying to remove them... we should let the user know that he is trying to remove a URL which is not valid or does not exist for that bug.
Attachment #560721 -
Flags: review?(timello) → review-
![]() |
Assignee | |
Comment 3•13 years ago
|
||
Comment on attachment 560721 [details] [diff] [review]
patch, v1
No, the doc for the Bug.update_see_also WebService states that "If you specify a URL that is not in the See Also field of a particular bug, it will just be silently ignored.". Throwing an error would break backward-compatibility, and it has always worked this way since Bugzilla 3.4.
Attachment #560721 -
Flags: review- → review?(timello)
Comment 4•13 years ago
|
||
Comment on attachment 560721 [details] [diff] [review]
patch, v1
It fixes the problem.
Attachment #560721 -
Flags: review?(timello) → review+
Updated•13 years ago
|
Flags: approval?
![]() |
Assignee | |
Updated•13 years ago
|
Flags: approval?
Flags: approval4.2+
Flags: approval+
![]() |
Assignee | |
Comment 5•13 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Bug.pm
Committed revision 7965.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/Bug.pm
Committed revision 7933.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•