Closed
Bug 352695
Opened 18 years ago
Closed 18 years ago
Custom select fields are mandatory on bug creation (despite they shouldn't be)
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.0
People
(Reporter: LpSolit, Assigned: bugzilla-mozilla)
Details
Attachments
(1 file, 1 obsolete file)
945 bytes,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
Try hacking the URL and don't include a custom select field. You get an error thrown by the validator which complains that you didn't give a valid value for this field. We could fix Bugzilla::Bug::_check_select_field() to return the default value if no value is given, except that this means hardcoding '---' in Bug.pm. I wonder if we should set '---' as default in the DB schema.
Comment 1•18 years ago
|
||
The solution is just to not pass the custom fields in, I think, if they're undef. But just those fields, because other fields should still be passed in, even if they're undef. It should be an easy fix to the map().
Reporter | ||
Updated•18 years ago
|
Flags: blocking3.0?
Updated•18 years ago
|
Flags: blocking3.0? → blocking3.0+
Assignee | ||
Updated•18 years ago
|
Assignee: create-and-change → bugzilla-mozilla
Assignee | ||
Comment 2•18 years ago
|
||
Attachment #242545 -
Flags: review?(mkanat)
Assignee | ||
Updated•18 years ago
|
Status: NEW → ASSIGNED
Reporter | ||
Comment 3•18 years ago
|
||
Comment on attachment 242545 [details] [diff] [review] Patch v1 >+# Undefined custom single select fields are not allowed as undefined is not a >+# legal value. Nit: I don't like the "are not allowed" part. This makes me think that I have to define them, always. Maybe should we only say that they are ignored. >+my @bug_fields = grep { $_->type != FIELD_TYPE_SINGLE_SELECT >+ || defined $cgi->param($_->name) } @custom_bug_fields; err... Why not: grep {defined $cgi->param($_->name)} @custom_bug_fields; only? I didn't test your patch, but I think that all undefined custom fields can be safely ignored.
Assignee | ||
Comment 4•18 years ago
|
||
Changes: - Better comment, hopefully - Ignores all undefined custom field codes (works)
Attachment #242545 -
Attachment is obsolete: true
Attachment #242907 -
Flags: review?(LpSolit)
Attachment #242545 -
Flags: review?(mkanat)
Reporter | ||
Comment 5•18 years ago
|
||
Comment on attachment 242907 [details] [diff] [review] Patch v2 >+my @bug_fields = grep { defined $cgi->param($_->name) } @custom_bug_fields; >+@bug_fields = map { $_->name } @bug_fields; Nit: you could do a *tiny* simplification by shifting these two lines: my @bug_fields = map { $_->name } @custom_bug_fields; @bug_fields = grep { defined $cgi->param($_) } @bug_fields; (we avoid one ->name) Anyway, your patch is working correctly. r=LpSolit
Attachment #242907 -
Flags: review?(LpSolit) → review+
Reporter | ||
Updated•18 years ago
|
Flags: approval?
Updated•18 years ago
|
Flags: approval? → approval+
Assignee | ||
Comment 6•18 years ago
|
||
Checking in post_bug.cgi; /cvsroot/mozilla/webtools/bugzilla/post_bug.cgi,v <-- post_bug.cgi new revision: 1.181; previous revision: 1.180 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•