Closed Bug 895813 Opened 11 years ago Closed 10 years ago

Mandatory custom fields whose visibility depends on a component are not required on bug creation

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: b.cropp, Assigned: LpSolit)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20100101 Firefox/17.0 (Beta/Release)
Build ID: 20121219124323

Steps to reproduce:

We created several custom fields which are mandatory for bug creation.


Actual results:

After upgrade from Bugzilla 4.2.4 to 4.4 over Bazaar these fields are not mandatory anymore while you create a new bug although the mandatory bit in field settings is still set.

Then if you try to change anything in that new bug, you are prompted to fill out every mandatory field.


Expected results:

You should be forced to fill the mandatory fields while bug creation (as it was in 4.2.4).
I cannot reproduce. How are your mandatory custom fields configured? Do they depend on some other fields and/or value?
They only appear, if a specific component is used.

Can be set on task creation: active	
Displayed in taskmail for new Tasks: active
Type: drop down
Is obsolete: inactive
Sortkey: 0
Is mandatory: active

I tried to change any settings except the mandatory bit with no success.
Keywords: qawanted
I can confirm that the bug only appears when "Field only appears when:" is set to a "Component". If you have the field always appear or it only appears when a "Product" is shown, then it will verify that the field is set when the bug is created.

My steps:
(1) Go to Administration -> Custom Fields -> Add a new custom field
(2) Set the type to a "Drop Down"
(3) Check "Can be set on bug creation"
(4) Check "Is Mandatory"
(5) Set "Field only appears when:" to "Component"
(6) Select a component
(7) Submit
(8) Click on the field
(9) Edit Legal values for this field
(10) Add 2-3 dummy values
(11) Submit
(12) Add a new bug
(13) Select the project/component specified in #5
(14) Set all of the fields, except for the new custom field
(15) Press submit, observe that it lets you submit the bug, even though your custom field hasn't been set.
I confirm that this issue only happens when the visibility is set to "Component". This is still an issue with Bugzilla 4.5.1.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: qawanted
Summary: Mandatory custom field not required on bug creation → Mandatory custom fields whose visibility depends on a component are not required on bug creation
Target Milestone: --- → Bugzilla 4.4
(In reply to b.cropp from comment #0)
> You should be forced to fill the mandatory fields while bug creation (as it
> was in 4.2.4).

It's also broken in 4.2. It was working fine in 4.0, though.
Keywords: regression
Attached patch patch, v1Splinter Review
In bug 782210, we moved the call to _check_field_is_mandatory() before setting $bug->{component_id}, which is why the validation always failed. We then fixed is_set_on_bug() in Bugzilla::Field::ChoiceInterface, but forgot to do the same for this method in Bugzilla::Component.
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #8351366 - Flags: review?(pami.ketolainen)
Attachment #8351366 - Flags: review?(dkl)
(In reply to Frédéric Buclin from comment #6)
> Created attachment 8351366 [details] [diff] [review]
> patch, v1

The patch looks OK to me, but I don't have the permission to accept the review flag.

One thing I noticed is that when you don't select a value for the required custom field it is not visible after you go back form "A value must be set for the 'Test' field. Please press Back and try again". The component needs to be reselected to make the field visible. But I guess that is not in the scope of this bug.
Attachment #8351366 - Flags: review?(pami.ketolainen) → review+
Flags: approval?
Flags: approval4.4?
Comment on attachment 8351366 [details] [diff] [review]
patch, v1

Review of attachment 8351366 [details] [diff] [review]:
-----------------------------------------------------------------

r=dkl
Attachment #8351366 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval4.4?
Flags: approval4.4+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Component.pm
Committed revision 8846.

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.4/
modified Bugzilla/Component.pm
Committed revision 8646.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Added to relnotes for 4.4.2.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: