-
Bug
-
Resolution: Fixed
-
Major
-
jenkins LTE 2.277.1, with latest plugins
active-choice plugin: 2.5.4
I belive that there is an issue with the:
script file, which after the tables to div transition is failed to find the DIV elements to populate the values
The generated element seems correct, without any TABLE elements:
<div name="parameter" description="server instance" id="choice-parameter-5762928123724098"><input name="name" type="hidden" value="SERVER_INSTANCE"><div style="float: left; overflow-y: auto; padding-right: 25px; height: 25px;" id="ecp_choice-parameter-5762928123724098"><div id="tbl_ecp_choice-parameter-5762928123724098"><div style="white-space:nowrap" id="tbl_tr_ecp_choice-parameter-5762928123724098" class="tr"><div><input otherid="ecp_choice-parameter-5762928123724098_0" alt="Script error" name="SERVER_INSTANCE" json="Script error" onchange="UnoChoice.fakeSelectRadioButton("SERVER_INSTANCE", "ecp_choice-parameter-5762928123724098_0")" type="radio" value="Script error" class=" "><label class="attach-previous">Script error</label><input name="" json="Script error" id="ecp_choice-parameter-5762928123724098_0" type="hidden" title="Script error" value="Script error" class="SERVER_INSTANCE"></div></div></div></div><script type="text/javascript">(function() { var f = function() { var height = 0; var maxCount = 1; if(maxCount > 1) { maxCount = 1; } var refElement = document.getElementById(""); if(maxCount > 0 && refElement && refElement.offsetHeight !=0) { for(var i=0; i< maxCount; i++) { height += refElement.offsetHeight + 3; } } else { height = maxCount * 25.5; } height = Math.floor(height); document.getElementById("ecp_choice-parameter-5762928123724098").style.height = height + "px"; }; f(); })();</script></div>
Also the groovy script seems to return the correct values for the Radio buttons, as enns in the browser's console log:
Values returned from server: [["element1:selected","element2"],["element1:selected","element2"]]
After more testing I can confirm that replacing TABLE in the if condition with DIV fixes the issues, here is a working copy:
if (parameterElement.children.length > 0 && parameterElement.children[0].tagName === 'DIV') {
For backward compatibility "TABLE or DIV" condition maybe would be the best
A possible fix: https://github.com/jenkinsci/active-choices-plugin/pull/45