Closed Bug 600616 Opened 14 years ago Closed 14 years ago

show_bug.cgi: Invalid parameter passed to Bugzilla::Search::Recent::_init

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

(Keywords: regression)

Attachments

(1 file, 1 obsolete file)

I was pretty sure this was already filed, but I cannot find it. I get this error too frequently to my taste:


Invalid parameter passed to Bugzilla::Search::Recent::_init: It must be numeric.

Traceback:

 at Bugzilla/Object.pm line 86
	Bugzilla::Object::_init(...) called at Bugzilla/Object.pm line 58
	Bugzilla::Object::new(...) called at Bugzilla/Object.pm line 145
	Bugzilla::Object::check(...) called at Bugzilla/Search/Recent.pm line 85
	Bugzilla::Search::Recent::check(...) called at Bugzilla/User.pm line 424
	eval {...} called at Bugzilla/User.pm line 424
	Bugzilla::User::recent_search_for(...) called at template/en/default/bug/navigate.html.tmpl line 42
	eval {...} called at template/en/default/bug/navigate.html.tmpl line 42
	eval {...} called at template/en/default/bug/navigate.html.tmpl line 18
	Template::Provider::__ANON__(...) called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Document.pm line 151
	eval {...} called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Document.pm line 149
	Template::Document::process(...) called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Context.pm line 351
	eval {...} called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Context.pm line 321
	Template::Context::process(...) called at Bugzilla/Template/Context.pm line 45
	Bugzilla::Template::Context::process(...) called at template/en/default/bug/show.html.tmpl line 43
	eval {...} called at template/en/default/bug/show.html.tmpl line 18
	Template::Provider::__ANON__(...) called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Document.pm line 151
	eval {...} called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Document.pm line 149
	Template::Document::process(...) called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Context.pm line 351
	eval {...} called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Context.pm line 321
	Template::Context::process(...) called at Bugzilla/Template/Context.pm line 45
	Bugzilla::Template::Context::process(...) called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Service.pm line 94
	eval {...} called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template/Service.pm line 91
	Template::Service::process(...) called at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi/Template.pm line 66
	Template::process(...) called at Bugzilla/Template.pm line 595
	Bugzilla::Template::process(...) called at /var/www/html/bugzilla/show_bug.cgi line 128
Flags: blocking4.0+
Oh, the URL has: list_id=cookie
Oh yeah, maybe this was the error that I was thinking of, that I was hitting frequently.
Depends on: 24896
Keywords: regression
Attached patch patch, v1 (obsolete) — Splinter Review
Make sure the list_id is a valid integer. Else look at the BUGLIST cookie.
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #482060 - Flags: review?(mkanat)
Comment on attachment 482060 [details] [diff] [review]
patch, v1

Hmm. Instead of this, I think that we should just explicitly check that it ne 'cookie'.
Attachment #482060 - Flags: review?(mkanat) → review-
(In reply to comment #4)
> Hmm. Instead of this, I think that we should just explicitly check that it ne
> 'cookie'.

Why? If you don't pass an integer, it fails exactly as described in comment 0. That's the point of this fix.
(In reply to comment #5)
> Why? If you don't pass an integer, it fails exactly as described in comment 0.
> That's the point of this fix.

  Ah, yeah, but the only string that *should* be passing through there is "cookie". So if there's some other string passing through, that's actually a problem, and we *should* fail.
I disagree. I just have to play with the URL and pass list_id=foo to make Bugzilla crash. That's bad design.
  Well, I understand where you're coming from, but computer programs are supposed to fail when given invalid input, rather than behave unexpectedly. You could possibly throw an error if there's a string and it's not "cookie", though.
Attached patch patch, v2Splinter Review
Attachment #482060 - Attachment is obsolete: true
Attachment #483013 - Flags: review?(mkanat)
Comment on attachment 483013 [details] [diff] [review]
patch, v2

Sweet, thanks. :-)
Attachment #483013 - Flags: review?(mkanat) → review+
Flags: approval4.0+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/User.pm
Committed revision 7537.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified Bugzilla/User.pm
Committed revision 7438.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: