Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-22570] On a configure screen that has multiple groups …
…of radio buttons, clicking the apply button clears all but the last radio group selection

- Changed from mutating the e.name value to maintaining an index and using that index to get the required substring

- Risk of unintended consequences is low. The Submit flow moves off the page before the consequences of the effect
  could be seen... though a careful attention to the page submit can identify the change... and the page is now
  left as before clicking f:apply instead of mutated.

(cherry picked from commit 88d84f6)
  • Loading branch information
stephenc authored and olivergondza committed May 5, 2014
1 parent 98f4b7d commit 1da70d3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions war/src/main/webapp/scripts/hudson-behavior.js
Expand Up @@ -1814,6 +1814,7 @@ function buildFormTree(form) {
}

var p;
var r;
var type = e.getAttribute("type");
if(type==null) type="";
switch(type.toLowerCase()) {
Expand Down Expand Up @@ -1861,11 +1862,12 @@ function buildFormTree(form) {
break;
case "radio":
if(!e.checked) break;
while (e.name.substring(0,8)=='removeme')
e.name = e.name.substring(e.name.indexOf('_',8)+1);
r=0;
while (e.name.substring(r,r+8)=='removeme')
r = e.name.indexOf('_',r+8)+1;
if(e.groupingNode) {
p = findParent(e);
addProperty(p, e.name, e.formDom = { value: e.value });
addProperty(p, e.name.substring(r), e.formDom = { value: e.value });
break;
}

Expand Down

0 comments on commit 1da70d3

Please sign in to comment.