In bug/create/create.html.tmpl, put set_assign_to() back into onload

RESOLVED FIXED in Bugzilla 3.6

Status

()

--
trivial
RESOLVED FIXED
12 years ago
9 years ago

People

(Reporter: Wurblzap, Assigned: LpSolit)

Tracking

2.23.3
Bugzilla 3.6
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Reporter)

Description

12 years ago
There is a code comment in bug/create/create.html.tmpl, saying that putting set_assign_to into onload doesn't work. Doing so seems to work for me, though... Either it indeed works, in which case I'm all for putting it back in. Or it doesn't, in which case I'd like the code comment to be a little more elaborate in telling me why :)

Comment 1

12 years ago
It doesn't work when there's only one component in your product, and it's auto-selected. You could add that comment if you want.

Is it causing any sort of problem for you?
(Reporter)

Comment 2

12 years ago
It doesn't cause any problem. I just wondered why we don't use header.html.tmpl's onload functionality, which I consider a clean solution to doing page-load JS stuff.

Now I know the doesn't-work-case, I'll see whether I'll try to fix it or whether I'll add a code comment.
(Assignee)

Comment 3

9 years ago
Hum, this seems to work just fine in Firefox 3.5.1 when moving set_assign_to() back into onload="".
(Assignee)

Comment 4

9 years ago
Created attachment 391310 [details] [diff] [review]
patch, v1

Tested successfully on IE 6, IE 8, Firefox 3.5.1, Opera 10.0 beta, Safari 4.0.2, Google Chrome 2.0.172.37, and Konqueror 4.2.4.

This works when there is a single component, several components, and also when you preselect the component with enter_bug.cgi?product=foo&component=bar. The assignee, QA, default CC and component description fields are populated correctly.

The key point is that set_assign_to() calls document.Create. This seems to do the job. (I found this while working on editflagtypes.cgi, which calls document.forms[0]. In that case, the form is not found on page load.)

This is a nice cleanup for HEAD, and will be consistent with what I'm going to use in editflagtypes.cgi.
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #391310 - Flags: review?(wurblzap)
(Assignee)

Updated

9 years ago
Target Milestone: --- → Bugzilla 3.6
(Assignee)

Updated

9 years ago
Summary: In bug/create/create.html.tmpl, put set_assign_to() back into onload (or make the code comment saying "it doesn't work" explain why we shouldn't) → In bug/create/create.html.tmpl, put set_assign_to() back into onload
(Assignee)

Updated

9 years ago
Attachment #391310 - Flags: review?(wurblzap) → review?(ghendricks)

Updated

9 years ago
Attachment #391310 - Flags: review?(ghendricks) → review+
(Assignee)

Updated

9 years ago
Flags: approval+
(Assignee)

Comment 5

9 years ago
Checking in template/en/default/bug/create/create.html.tmpl;
/cvsroot/mozilla/webtools/bugzilla/template/en/default/bug/create/create.html.tmpl,v  <--  create.html.tmpl
new revision: 1.96; previous revision: 1.95
done
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.