Commit b82afafe authored by tara%tequilarista.org's avatar tara%tequilarista.org

Landing patch for bug #58436 from Henrik Gemal

parent 2093c1cb
...@@ -428,7 +428,7 @@ function selectProduct(f) { ...@@ -428,7 +428,7 @@ function selectProduct(f) {
if (doit) { if (doit) {
var l = f.component.length; var l = f.component.length;
f.component[l] = new Option(c, c); f.component[l] = new Option(c, c);
if (csel[c]) { if (csel.length && csel[c]) {
f.component[l].selected = true; f.component[l].selected = true;
} }
} }
...@@ -445,13 +445,13 @@ function selectProduct(f) { ...@@ -445,13 +445,13 @@ function selectProduct(f) {
for (v in vers) { for (v in vers) {
if (typeof(vers[v]) == 'function') continue; if (typeof(vers[v]) == 'function') continue;
var doit = doall; doit = doall;
for (i=0 ; !doit && i<f.product.length ; i++) { for (i=0 ; !doit && i<f.product.length ; i++) {
if (f.product[i].selected) { if (f.product[i].selected) {
var p = f.product[i].value; p = f.product[i].value;
for (j in vers[v]) { for (j in vers[v]) {
if (typeof(vers[v][j]) == 'function') continue; if (typeof(vers[v][j]) == 'function') continue;
var p2 = vers[v][j]; p2 = vers[v][j];
if (p2 == p) { if (p2 == p) {
doit = true; doit = true;
break; break;
...@@ -460,15 +460,15 @@ function selectProduct(f) { ...@@ -460,15 +460,15 @@ function selectProduct(f) {
} }
} }
if (doit) { if (doit) {
var l = f.version.length; l = f.version.length;
f.version[l] = new Option(v, v); f.version[l] = new Option(v, v);
if (vsel[v]) { if (vsel.length && vsel[v]) {
f.version[l].selected = true; f.version[l].selected = true;
} }
} }
} }
if (f.target_milestone) { if ("target_milestone" in f) {
var tmsel = new Array(); var tmsel = new Array();
for (i=0 ; i<f.target_milestone.length ; i++) { for (i=0 ; i<f.target_milestone.length ; i++) {
if (f.target_milestone[i].selected) { if (f.target_milestone[i].selected) {
...@@ -480,13 +480,13 @@ function selectProduct(f) { ...@@ -480,13 +480,13 @@ function selectProduct(f) {
for (tm in tms) { for (tm in tms) {
if (typeof(tms[v]) == 'function') continue; if (typeof(tms[v]) == 'function') continue;
var doit = doall; doit = doall;
for (i=0 ; !doit && i<f.product.length ; i++) { for (i=0 ; !doit && i<f.product.length ; i++) {
if (f.product[i].selected) { if (f.product[i].selected) {
var p = f.product[i].value; p = f.product[i].value;
for (j in tms[tm]) { for (j in tms[tm]) {
if (typeof(tms[tm][j]) == 'function') continue; if (typeof(tms[tm][j]) == 'function') continue;
var p2 = tms[tm][j]; p2 = tms[tm][j];
if (p2 == p) { if (p2 == p) {
doit = true; doit = true;
break; break;
...@@ -495,9 +495,9 @@ function selectProduct(f) { ...@@ -495,9 +495,9 @@ function selectProduct(f) {
} }
} }
if (doit) { if (doit) {
var l = f.target_milestone.length; l = f.target_milestone.length;
f.target_milestone[l] = new Option(tm, tm); f.target_milestone[l] = new Option(tm, tm);
if (tmsel[tm]) { if (tmsel.length && tmsel[tm]) {
f.target_milestone[l].selected = true; f.target_milestone[l].selected = true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment