Closed Bug 768573 Opened 12 years ago Closed 12 years ago

bug/field.html.tmpl overrides the 'hidden' variable, causing some field labels to be hidden by accident

Categories

(Bugzilla :: User Interface, defect)

4.3.1
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 4.4

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file, 1 obsolete file)

While reviewing bug 766528, I realized that several labels were missing in the UI. The reason was that the last custom field was hidden and so the hidden variable was set to 1. As bug/field.html.tmpl is PROCESS'ed, this variable is visible outside this template, and affects all other template calls, for instance bug/field-label.html.tmpl. To force the variable to remain local, the bug/field.html.tmpl template must be INCLUDE'd, not PROCESS'ed.
Flags: blocking4.4+
Attached patch patch, v1 (obsolete) — Splinter Review
Attachment #636807 - Flags: review?(glob)
Comment on attachment 636807 [details] [diff] [review]
patch, v1

r=glob
Attachment #636807 - Flags: review?(glob) → review+
Flags: approval4.2+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified template/en/default/bug/edit.html.tmpl
modified template/en/default/bug/knob.html.tmpl
modified template/en/default/bug/show-multiple.html.tmpl
modified template/en/default/list/edit-multiple.html.tmpl
Committed revision 8271.


Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified template/en/default/bug/edit.html.tmpl
modified template/en/default/bug/knob.html.tmpl
modified template/en/default/bug/show-multiple.html.tmpl
modified template/en/default/list/edit-multiple.html.tmpl
Committed revision 8098.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
The patch causes test_custom_fields.t to fail. The reason is that extra_field_item is no longer accessible outside bug/field.html.tmpl, and so bug/edit.html.tmpl can no longer use it to display related bugs. I suspect bug/field.html.tmpl should display the extra_field_item data itself.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
If the fix is not trivial, we should simply backout the patch from the 4.2 branch as it's not necessary there. For trunk, we need it to not regress bug 766528.
Ok, backed out from the 4.2 branch: Committed revision 8105. As I said in comment 5, we still need it for trunk.
Flags: approval4.2+
Target Milestone: Bugzilla 4.2 → Bugzilla 4.4
I also backed out the patch from the trunk: Committed revision 8309. I have a better fix.
Status: REOPENED → ASSIGNED
Flags: approval+
Summary: Templates must INCLUDE bug/field.html.tmpl instead of PROCESS'ing it → bug/field.html.tmpl overrides the 'hidden' variable, causing some field labels to be hidden by accident
Attached patch patch, v2Splinter Review
This is a much better patch which simply renames the 'hidden' variable to 'field_hidden', which isn't used elsewhere and so won't override the more commonly used 'hidden' variable. Also, INCLUDE'ing bug/field-label.html.tmpl instead of PROCESS'ing it will prevent this template from altering this variable too. This was the single place in our codebase to use PROCESS instead of INCLUDE when calling this template.
Attachment #636807 - Attachment is obsolete: true
Attachment #646912 - Flags: review?(glob)
Comment on attachment 646912 [details] [diff] [review]
patch, v2

r=glob much cleaner :)
Attachment #646912 - Flags: review?(glob) → review+
Flags: approval+
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified template/en/default/bug/field.html.tmpl
Committed revision 8317.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: