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 :)
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?
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.
Hum, this seems to work just fine in Firefox 3.5.1 when moving set_assign_to() back into onload="".
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 22.214.171.124, 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. 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)
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
Attachment #391310 - Flags: review?(wurblzap) → review?(ghendricks)
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.