Hi. I'm trying to fix this issue:

https://github.com/jenkinsci/docker-plugin/issues/5

In my jelly, I have a repeatable section:

 <f:repeatable field="templates">
  // ... config stuff here
 </f:repeatable>

>From an interaction POV, this works fine. But it bombs out trying to
construct the JSON to return to Jenkins, and I don't really understand why.

What seems to be happening is that the first child gets added to the parent
as an object, not an array.

hudson-behaviour.js:1768 does this:

function addProperty(parent,name,value) {
  name = shortenName(name);
  if(parent[name]!=null) {
     if(parent[name].push==null) // is this array?
         parent[name] = [ parent[name] ];
          parent[name].push(value);
   } else {
            parent[name] = value;
    }
}


The first time through, parent['templates'] == null, so an empty object is
assigned.

The second time through, parent['templates'] != null, so it attempts to
push the value onto an object, not an array (and so bombs out).

The template is pretty simple, and copied from a separate plugin. What's
going wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to