Closed
Bug 645433
Opened 14 years ago
Closed 13 years ago
Bugzilla->error_mode( ERROR_MODE_WEBPAGE ) doesn't change Bugzilla->error_mode
Categories
(Bugzilla :: Bugzilla-General, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.4
People
(Reporter: yavor.nikolov7+bugzilla, Assigned: koosha.khajeh)
References
Details
Attachments
(1 file)
667 bytes,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: 4.1.1
This is very similar to bug #645427
sub error_mode {
...
return $class->request_cache->{error_mode}
|| (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE);
}
With ERROR_MODE_WEBPAGE the above return always ignores first part of the || expression because ERROR_MODE_WEBPAGE == 0.
Reproducible: Always
Steps to Reproduce:
From console app run Bugzilla->usage_mode( USAGE_MODE_BROWSER ) - this also attempts to change error_mode
Actual Results:
Bugzilla->error_mode( ERROR_MODE_WEBPAGE ) doesn't change Bugzilla->usage_mode to ERROR_MODE_WEBPAGE
Expected Results:
Bugzilla->error_mode( ERROR_MODE_WEBPAGE ) should change Bugzilla->usage_mode to ERROR_MODE_WEBPAGE
Reporter | ||
Comment 1•14 years ago
|
||
In Expected/Actual Results of problem description Bugzilla->usage_mode should be read as Bugzilla->error_mode.
Comment 2•14 years ago
|
||
We should check "exists $class->request_cache->{error_mode}".
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → 4.1.1
Updated•14 years ago
|
Severity: normal → minor
Updated•14 years ago
|
Whiteboard: [Good Intro Bug]
The return statement in the 'else' part could also be written without the 'else'. That is outside the last if.
Attachment #617199 -
Flags: review?(mkanat)
Attachment #617199 -
Flags: review?(LpSolit)
Comment 4•13 years ago
|
||
Comment on attachment 617199 [details] [diff] [review]
V1
>- return $class->request_cache->{error_mode}
>- || (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE);
>+ if (exists($class->request_cache->{error_mode}) {
There is a missing closing parenthesis.
>+ return $class->request_cache->{error_mode};
>+ }
>+ else {
>+ return (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE);
>+ }
As for bug 645427, I will add a comment about making the code cleaner once we require Perl 5.10.1. r=LpSolit
Attachment #617199 -
Flags: review?(mkanat)
Attachment #617199 -
Flags: review?(LpSolit)
Attachment #617199 -
Flags: review+
Comment 5•13 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla.pm
Committed revision 8214.
Assignee: general → koosha.khajeh
Status: NEW → RESOLVED
Closed: 13 years ago
Depends on: 655477
Flags: approval+
Resolution: --- → FIXED
Whiteboard: [Good Intro Bug]
Target Milestone: --- → Bugzilla 4.4
You need to log in
before you can comment on or make changes to this bug.
Description
•