Closed
Bug 371070
Opened 17 years ago
Closed 17 years ago
Move basic validations from process_bug.cgi into Bugzilla::Bug
Categories
(Bugzilla :: Creating/Changing Bugs, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.2
People
(Reporter: mkanat, Assigned: mkanat)
References
Details
Attachments
(1 file, 1 obsolete file)
7.58 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
This is just like the very first thing we did to Bug.pm-ize post_bug. Some fields have very simple validators, like the "comment" field, and we can just directly use our Bugzilla::Bug->_check functions in process_bug to simplify those checks.
Assignee | ||
Updated•17 years ago
|
Severity: normal → enhancement
Assignee | ||
Comment 1•17 years ago
|
||
For process_bug, certain fields can be validated once, even on a multiple-bug change, and they are simple validations. Those are the ones we're going to move, here.
Summary: Move some basic validations from process_bug.cgi into Bugzilla::Bug → Move simple validations from process_bug.cgi into Bugzilla::Bug for fields that don't depend on other fields
Assignee | ||
Updated•17 years ago
|
Summary: Move simple validations from process_bug.cgi into Bugzilla::Bug for fields that don't depend on other fields → Move basic validations from process_bug.cgi into Bugzilla::Bug
Assignee | ||
Comment 2•17 years ago
|
||
This is really, really basic stuff. It just gets some of the validations out of process_bug and into Bugzilla::Bug. It gave me a feel for where to go next, too.
Assignee: create-and-change → mkanat
Status: NEW → ASSIGNED
Attachment #255845 -
Flags: review?(LpSolit)
Comment 3•17 years ago
|
||
Comment on attachment 255845 [details] [diff] [review] v1 >Index: process_bug.cgi > foreach my $field ("estimated_time", "work_time", "remaining_time") { > if (defined $cgi->param($field)) { >- my $er_time = trim($cgi->param($field)); >- if ($er_time ne $cgi->param('dontchange')) { >- Bugzilla::Bug::ValidateTime($er_time, $field); >- } >+ $cgi->param($field, $bug->_check_time($cgi->param($field), $field)); > } > } If you are changing several bugs at once, you get an error: The value '--do_not_change--' in the Orig. Est. field is not a numeric value. You have to do this check only if ($er_time ne $cgi->param('dontchange')). >+ my $prod = $bug->_check_product($cgi->param('product')); Nit: please update $cgi->param('product') with $prod->name, as you did for the component. >Index: Bugzilla/Bug.pm > sub _check_bug_file_loc { > my ($invocant, $url) = @_; >+ $url = '' if !defined($url); Are you sure this won't overwrite the URL field when changing several bugs at once? Most of the time, we ignore undefined fields, but consider empty fields as their new value. >+ # Creation-only checks >+ if (!ref $invocant) { >+ $comment = ' ' if $comment eq '' && !ref($invocant); You already know that !ref($invocant) is true. That's the block you are in.
Attachment #255845 -
Flags: review?(LpSolit) → review-
Assignee | ||
Comment 4•17 years ago
|
||
URL can't be changed in a mass-change. I fixed everything else.
Attachment #255845 -
Attachment is obsolete: true
Attachment #257373 -
Flags: review?(LpSolit)
Comment 5•17 years ago
|
||
Comment on attachment 257373 [details] [diff] [review] v2 Looks good. r=LpSolit
Attachment #257373 -
Flags: review?(LpSolit) → review+
Updated•17 years ago
|
Flags: approval+
Assignee | ||
Comment 6•17 years ago
|
||
Checking in process_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/process_bug.cgi,v <-- process_bug.cgi new revision: 1.352; previous revision: 1.351 done Checking in Bugzilla/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.173; previous revision: 1.172 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•