Closed Bug 482365 Opened 16 years ago Closed 16 years ago

Values displayed in userselect.html.tmpl may be incorrect if "value" is not explicitly set

Categories

(Bugzilla :: User Interface, defect)

3.2.2
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 3.2

People

(Reporter: paul.schulz, Assigned: LpSolit)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030423 Ubuntu/8.10 (intrepid) Firefox/3.0.7 Build Identifier: rv:1.9.0.7) Gecko/2009030423 Ubuntu/8.10 (intrepid) Firefox/3.0.7 When viewing a bug, the value set for the custom field, shows up at the bottom of the 'menu for users' in the flags. Reproducible: Always Steps to Reproduce: 1. Create custom field, change order so that default is a new value. 2. Create a flag. 3. Enable 'usemenuforusesr' option (to display list for flags). eg. Local bugzilla has been modified with a custom field (Dropdown called 'Issue Type') where the Sortkey has been changed on the '---' value to make it the last in the list, and a different (custom value) is displayed as the default. eg. (from Custom Field value configuration screen) Edit field value... Sortkey Action Defect 10 Delete Enhancement 20 Delete Release 30 Delete Super 40 Delete --- 50 (Non-deletable value) Several flags have also been created for bugs The 'usemenuforusers' option has also been set to allow the users to be listed. Actual Results: Look at a bug.. and the values displayed in the 'user list'. It contains the custom field value. Expected Results: 'user list' should just be a list of users, and maybe an empty default. Screenshot available
Attached image Screenshot of problem.
Added version.
Version: unspecified → 3.2.2
The problem is that "value" may be defined earlier in the code, and when global/userselect.html.tmpl is called with no value for "value", the old parameter is taken into account here.
Assignee: query-and-buglist → ui
Status: UNCONFIRMED → NEW
Component: Query/Bug List → User Interface
Ever confirmed: true
Flags: blocking3.4+
Flags: blocking3.2.3+
OS: Linux → All
Hardware: x86_64 → All
Target Milestone: --- → Bugzilla 3.2
Side effect of bug 465589.
Assignee: ui → LpSolit
Status: NEW → ASSIGNED
Depends on: 465589
Attached patch patch, v1 (obsolete) — Splinter Review
Patch written against 3.2.2, but should apply cleanly on tip as well. "undef" is not the magic undef we know in Perl, but as this variable is undefined, this has the same effect.
Attachment #366453 - Flags: review?(wicked)
Attached patch patch, v1.1Splinter Review
This patch has the same effect as the previous one, except I explicitly set value for each call to userselect.html.tmpl. I thought [% value = undef %] would leave value undefined, as undef is not set, but in fact it sets value to "", so I could as well write it explicitly. In userselect.html.tmpl, we check selected.defined, but thanks to the split() method, it ignores empty values, so we are safe. This patch partially back out what I did in bug 465589 as INCLUDE doesn't isolate data passed to templates (and so we have to specify "value" even when we don't need it, to avoid catching an older definition of "value").
Attachment #366453 - Attachment is obsolete: true
Attachment #366463 - Flags: review?(wicked)
Attachment #366453 - Flags: review?(wicked)
Summary: With custom field (modified Sortkey), flags display incorrect default with 'usemenuforusers' on. → Values displayed in userselect.html.tmpl may be incorrect if "value" is not explicitly set
Comment on attachment 366463 [details] [diff] [review] patch, v1.1 Looks good and indeed fixes the reported problem. Note that for trunk bug/edit.html.tmpl change fails to apply but can be easily fixed manually after using fuzz factor 3.
Attachment #366463 - Flags: review?(wicked) → review+
Flags: approval?
Flags: approval3.4?
Flags: approval3.2?
We didn't branch yet, so approval3.4 is not yet in use. ;)
Flags: approval?
Flags: approval3.4?
Flags: approval3.2?
Flags: approval3.2+
Flags: approval+
tip: Checking in template/en/default/admin/components/create.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/create.html.tmpl,v <-- create.html.tmpl new revision: 1.17; previous revision: 1.16 done Checking in template/en/default/bug/edit.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl,v <-- edit.html.tmpl new revision: 1.156; previous revision: 1.155 done Checking in template/en/default/flag/list.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/flag/list.html.tmpl,v <-- list.html.tmpl new revision: 1.35; previous revision: 1.34 done 3.2.2: Checking in template/en/default/admin/components/create.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/admin/components/create.html.tmpl,v <-- create.html.tmpl new revision: 1.14.2.3; previous revision: 1.14.2.2 done Checking in template/en/default/bug/edit.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/edit.html.tmpl,v <-- edit.html.tmpl new revision: 1.125.2.20; previous revision: 1.125.2.19 done Checking in template/en/default/flag/list.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/flag/list.html.tmpl,v <-- list.html.tmpl new revision: 1.32.2.1; previous revision: 1.32 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: