Closed
Bug 676430
Opened 14 years ago
Closed 14 years ago
When editing a bug, a user not in the timetracking group generates "Use of uninitialized value in abs at Bugzilla/Bug.pm line 2682" in the web server error log
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.2
People
(Reporter: LpSolit, Assigned: LpSolit)
References
Details
(Keywords: regression)
Attachments
(1 file)
624 bytes,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
I cannot reproduce in 4.0.1, only in 4.1.2. If I'm not in the timetracking group, editing a bug triggers the following warning in the web server error log:
"Use of uninitialized value in abs at Bugzilla/Bug.pm line 2682". The corresponding line is in add_comment():
if ($comment eq '' && !($params->{type} || abs($params->{work_time})))
So work_time is undefined, and Perl 5.12.3 complains.
Flags: blocking4.2+
![]() |
Assignee | |
Comment 1•14 years ago
|
||
This is a regression due to bug 590334. In 4.0, _check_work_time() was called before abs(...) and returned 0 if work_time wasn't defined. In 4.2, abs() is called first, making it get an undefined value if the user is not in the timetracking field. Looks like a trivial abs(... || 0) will do it.
Depends on: 590334
![]() |
Assignee | |
Comment 2•14 years ago
|
||
mkanat, what do you prefer? abs(work_time || 0), or calling validators before calling abs()?
Comment 3•14 years ago
|
||
(In reply to comment #2)
> mkanat, what do you prefer? abs(work_time || 0), or calling validators
> before calling abs()?
Ah, just the || 0 seems like the simpler fix for now.
![]() |
Assignee | |
Comment 4•14 years ago
|
||
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #550910 -
Flags: review?(mkanat)
![]() |
Assignee | |
Updated•14 years ago
|
Severity: normal → trivial
Updated•14 years ago
|
Attachment #550910 -
Flags: review?(mkanat) → review+
Updated•14 years ago
|
Flags: approval+
![]() |
Assignee | |
Comment 5•14 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Bug.pm
Committed revision 7895.
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.
Description
•