Closed Bug 817814 Opened 13 years ago Closed 12 years ago

mandatory custom field ignored on bug creation (Field only appears)

Categories

(Bugzilla :: Bugzilla-General, defect)

4.2.3
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 782210

People

(Reporter: tpham, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Firefox/17.0 Build ID: 20121119183901 Steps to reproduce: - Created a custom field of type drop down - Check "Can be set on bug creation" - Check "Is mandatory" - For "Field only appears when", select Product, and then select any Bugzilla product - Add few legal values for this field - Create a new bug. Leave the default value for this mandatory field to '---'. Actual results: - Bug is created successfully. Expected results: - Bug creation should fail. If you do not set "Field only appears when", then it's working--bug creation will fail. Look like $field->is_visible_on_bug always return 0.
Bug confirmed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Bugzilla 4.2
I don't know if it can help, bug I found a work around: In Bug.pm, in the run_create_validators function, I added the following line: $params->{product}=$product->name; just before the check on mandatory fields foreach my $field (@mandatory_fields) { $class->_check_field_is_mandatory($params->{$field->name}, $field,$params); } remark: to limit the risk of side effects I delete it afterwards, but I don't think that's usefull: delete $params->{product};
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
Target Milestone: Bugzilla 4.2 → ---
You need to log in before you can comment on or make changes to this bug.