Closed
Bug 522428
Opened 16 years ago
Closed 16 years ago
Bugzilla::Bug->create should be case-insensitive for global select fields
Categories
(Bugzilla :: Creating/Changing Bugs, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: mkanat, Assigned: mkanat)
References
Details
(Whiteboard: [es-lambda])
Attachments
(1 file, 2 obsolete files)
|
3.48 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
Right now, Bugzilla::Bug->create is case-sensitive for fields like priority, even though Bugzilla itself is not usually case-sensitive about those fields.
| Assignee | ||
Updated•16 years ago
|
Whiteboard: [es-lambda]
| Assignee | ||
Updated•16 years ago
|
Summary: Bugzilla::Bug->create should be case-insensitive for select fields → Bugzilla::Bug->create should be case-insensitive for global select fields
| Assignee | ||
Comment 1•16 years ago
|
||
I accomplished it by using Bugzilla::Field::Choice->check, which also allowed me to do a lot of nice cleanup.
Note that check_multi_select no longer has trick_taint in it because the return value of _check_single_select is untainted always.
Updated•16 years ago
|
Attachment #406401 -
Flags: review?(dkl) → review-
Comment 2•16 years ago
|
||
Comment on attachment 406401 [details] [diff] [review]
v1
> sub _check_multi_select_field {
>+ push(@checked_values, $invocant->_check_select_field($field, $value));
Arguments are passed in the wrong order, see below.
> sub _check_select_field {
> my ($invocant, $value, $field) = @_;
Didn't test it.
| Assignee | ||
Comment 3•16 years ago
|
||
Thanks for catching that! :-)
Attachment #406401 -
Attachment is obsolete: true
Attachment #406844 -
Flags: review?(LpSolit)
Updated•16 years ago
|
Attachment #406844 -
Flags: review?(LpSolit) → review+
Comment 4•16 years ago
|
||
Comment on attachment 406844 [details] [diff] [review]
v2
>+ if ($resolution ne '') {
>+ $resolution = $self->_check_select_field($resolution, 'resolution');
>+ }
You must do this check unconditionally. At this point, it's impossible for $resolution to be ''; this is caught earlier in _check_resolution() (this subroutine isn't called for open bugs). So please remove the if () check.
> sub _check_select_field {
>- $value = trim($value);
>+ my $object = Bugzilla::Field::Choice->type($field)->check($value);
You no longer trim() the input value, meaning that e.g. 'major ' is no longer accepted as a valid severity. Bugzilla::Object->check() trims the input value to check for its existence, but that's not the value it passes to new(), so we still have to trim it somewhere.
r=LpSolit with both comments fixed
Updated•16 years ago
|
Flags: approval+
| Assignee | ||
Comment 5•16 years ago
|
||
(In reply to comment #4)
> You must do this check unconditionally. At this point, it's impossible for
> $resolution to be ''; this is caught earlier in _check_resolution() (this
> subroutine isn't called for open bugs). So please remove the if () check.
Okay, I'll attach a new patch that fixes that.
> You no longer trim() the input value, meaning that e.g. 'major ' is no longer
> accepted as a valid severity. Bugzilla::Object->check() trims the input value
> to check for its existence, but that's not the value it passes to new(), so we
> still have to trim it somewhere.
Ah, instead of fixing that in this patch, I've fixed it in Bugzilla::Object, in bug 519584, and I'll wait for that to go in before I check in this patch.
| Assignee | ||
Comment 6•16 years ago
|
||
Carrying forward r+.
Attachment #406844 -
Attachment is obsolete: true
Attachment #407888 -
Flags: review+
| Assignee | ||
Comment 7•16 years ago
|
||
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm
new revision: 1.291; previous revision: 1.290
done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•