Closed Bug 246778 Opened 16 years ago Closed 16 years ago

ThrowUserError causes internal error with timetracking

Categories

(Bugzilla :: Bugzilla-General, defect, major)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: Wurblzap, Assigned: Wurblzap)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Build Identifier: 

Similarly to the effects described in bug 240036, ThrowUserError() crashes 
with "Table 'namedqueries' was not locked with LOCK TABLES" when you enter non-
numerical values for estimated hours.

Reproducible: Always
Steps to Reproduce:
1. Log on to Bugzilla with an account that is a member of the group
   that is configured in the "timetrackinggroup" param.
2. On a bug, enter "1,5" instead of "1.5" in the "estimated hours" field.
3. Click submit.
Actual Results:  
The described Bugzilla internal error is shown.

Expected Results:  
A well-formed error message from user-error.html.tmpl should show up ("Hours 
requires a numeric value").

Equivalently to bug 240036, this can be cured by replacing
   ThrowUserError("need_numeric_value")
with
   ThrowUserError("need_numeric_value", "abort")
in globals.pl.

Perhaps there are more places in the code where a similar change may be 
necessary?
Sorry about my confusion -- please make that "Hours Worked" where I'm talking 
about estimated hours. (Just reproduced on 
http://landfill.bugzilla.org/bugzilla-tip/).
Found another sibling besides bug 240036: bug 218977.
Thanks for opening the bug, Marc. Might I interest you in producing a patch
against CVS HEAD for integration?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Sure. It's a one-liner, after all.

The patch addresses the Hours Worked issue only. There are several further
occurrences of ThrowUserError without a third parameter. Now who can tell which
ones need to be patched?

Should this bug be marked critical like bug 233124 or a blocker like bug
218977?
Comment on attachment 151166 [details] [diff] [review]
Patch to fix crash on non-numerical Hours Worked field

Yeah.
Attachment #151166 - Flags: review+
Assignee: justdave → marcschum
Flags: approval+
Target Milestone: --- → Bugzilla 2.18
Upping to major since it's important but in an optional feature.

We should audit the other cases and check if tables are locked when calling
ThrowUseError.
Severity: normal → major
Status: NEW → ASSIGNED
Summary: ThrowUserError causes internal error → ThrowUserError causes internal error with timetracking
Target Milestone: Bugzilla 2.18 → ---
Target Milestone: --- → Bugzilla 2.18
Checking in globals.pl;
/cvsroot/mozilla/webtools/bugzilla/globals.pl,v  <--  globals.pl
new revision: 1.269; previous revision: 1.268
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
(In reply to comment #6)
> We should audit the other cases and check if tables are locked when calling
> ThrowUseError.

Has anyone done this audit, or raised a bug to remind us to do it?
Blocks: 276967
(In reply to comment #8)
> > We should audit the other cases and check if tables are locked when calling
> > ThrowUseError.
> 
> Has anyone done this audit, or raised a bug to remind us to do it?

I just filed bug 276967 for that.
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.