Closed Bug 1196969 Opened 9 years ago Closed 9 years ago

Custom fields whose visibility depends on the product are not displayed/hidden correctly

Categories

(Bugzilla :: Creating/Changing Bugs, defect)

defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 5.0

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch, v1 (obsolete) — Splinter Review
For some reason, the product field is not displayed using bug/field.html.tmpl and so doesn't contain the JS code which controls the visibility of custom fields depending on it. This explains why a custom field remains visible/hidden when it shouldn't. This is very problematic, because if a mandatory custom field is supposed to be displayed but is not, process_bug.cgi will reject your changes because the mandatory custom field contains no data. And so you have no way to submit your changes.

If the mandatory custom field is of type 'textarea', the (edit) link is displayed by default, but if this field is empty, the web browser will complain that you must enter some text, but is unable to point to the field because it's hidden. So I also fixed this problem.
Attachment #8650727 - Flags: review?(dkl)
Attached patch patch, v1.1Splinter Review
My previous patch forgot to take classifications into account, if they are enabled.
Attachment #8650727 - Attachment is obsolete: true
Attachment #8650727 - Flags: review?(dkl)
Attachment #8650982 - Flags: review?(dkl)
Severity: normal → major
Can you tell me what conditions reproduce this bug?

I have created a custom field which is mandatory and depends on the value of Product, but when I try and file a new bug in that product, the field is displayed correctly. And it's also displayed correctly when I update bugs in that product.

Gerv
Flags: needinfo?(LpSolit)
If your mandatory custom field (e.g. a textarea field, so that you can test all pieces of the patch) is only displayed for productA and your are currently in productB, and you decide to move the bug into productA, Bugzilla will refuse to commit your changes, because you are supposed to enter some data into the mandatory custom field. But because this field is not displayed, you cannot enter any data in it and so you cannot move the bug into productA.
Flags: needinfo?(LpSolit)
Comment on attachment 8650982 [details] [diff] [review]
patch, v1.1

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

r=gerv.

Gerv
Attachment #8650982 - Flags: review?(dkl) → review+
Flags: approval?
Flags: approval5.0?
Flags: approval?
Flags: approval5.0?
Flags: approval5.0+
Flags: approval+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   7a99779..246c04a  master -> master

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   2113247..7d3c1b0  5.0 -> 5.0
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Summary: Custom fields whose visibility depend on the product are not displayed/hidden correctly → Custom fields whose visibility depends on the product are not displayed/hidden correctly
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: