diff --git a/core/src/main/java/hudson/model/Descriptor.java b/core/src/main/java/hudson/model/Descriptor.java index bb6eeb2126..2b5bcef0cf 100644 --- a/core/src/main/java/hudson/model/Descriptor.java +++ b/core/src/main/java/hudson/model/Descriptor.java @@ -909,7 +909,11 @@ public abstract class Descriptor> implements Saveable { if (formData!=null) { for (Object o : JSONArray.fromObject(formData)) { JSONObject jo = (JSONObject)o; - String kind = jo.getString("kind"); + String kind = jo.optString("$class", null); + if (kind == null) { + // Legacy: Remove once plugins have been staged onto $class + kind = jo.getString("kind"); + } Descriptor d = find(descriptors, kind); if (d != null) { items.add(d.newInstance(req, jo)); diff --git a/core/src/main/java/jenkins/model/GlobalProjectNamingStrategyConfiguration.java b/core/src/main/java/jenkins/model/GlobalProjectNamingStrategyConfiguration.java index 616d3bd2fc..9289a23f1b 100644 --- a/core/src/main/java/jenkins/model/GlobalProjectNamingStrategyConfiguration.java +++ b/core/src/main/java/jenkins/model/GlobalProjectNamingStrategyConfiguration.java @@ -44,7 +44,7 @@ public class GlobalProjectNamingStrategyConfiguration extends GlobalConfiguratio final JSONObject optJSONObject = json.optJSONObject("useProjectNamingStrategy"); if (optJSONObject != null) { final JSONObject strategyObject = optJSONObject.getJSONObject("namingStrategy"); - final String className = strategyObject.getString("stapler-class"); + final String className = strategyObject.getString("$class"); try { Class clazz = Class.forName(className, true, Jenkins.getInstance().getPluginManager().uberClassLoader); final ProjectNamingStrategy strategy = (ProjectNamingStrategy) req.bindJSON(clazz, strategyObject); diff --git a/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly b/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly index a2b3407af4..667e123f29 100644 --- a/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly +++ b/core/src/main/resources/hudson/slaves/DumbSlave/configure-entries.jelly @@ -56,9 +56,7 @@ THE SOFTWARE. - - - + @@ -76,9 +74,7 @@ THE SOFTWARE. - - - + diff --git a/core/src/main/resources/lib/form/class-entry.jelly b/core/src/main/resources/lib/form/class-entry.jelly new file mode 100644 index 0000000000..e03af3a754 --- /dev/null +++ b/core/src/main/resources/lib/form/class-entry.jelly @@ -0,0 +1,47 @@ + + + + + Invisible <f:entry> type for embedding a descriptor's $class field. + + The describable class that we are instantiating via structured form submission. + + + The descriptor of the describable that we are instantiating via + structured form submission. Mutually exclusive with clazz. + + + + + + + + + + + + + \ No newline at end of file diff --git a/core/src/main/resources/lib/form/descriptorRadioList.jelly b/core/src/main/resources/lib/form/descriptorRadioList.jelly index 5193df8043..6e20b815e6 100644 --- a/core/src/main/resources/lib/form/descriptorRadioList.jelly +++ b/core/src/main/resources/lib/form/descriptorRadioList.jelly @@ -53,9 +53,7 @@ THE SOFTWARE. title="${d.displayName}" checked="${instance.descriptor==d}"> - - - + diff --git a/core/src/main/resources/lib/form/dropdownListBlock.jelly b/core/src/main/resources/lib/form/dropdownListBlock.jelly index d06278a673..426c61fd41 100644 --- a/core/src/main/resources/lib/form/dropdownListBlock.jelly +++ b/core/src/main/resources/lib/form/dropdownListBlock.jelly @@ -50,11 +50,7 @@ THE SOFTWARE. - - - - - + @@ -65,6 +61,9 @@ THE SOFTWARE. + + + diff --git a/core/src/main/resources/lib/form/hetero-list.jelly b/core/src/main/resources/lib/form/hetero-list.jelly index 985f687e3a..0f969e2aba 100644 --- a/core/src/main/resources/lib/form/hetero-list.jelly +++ b/core/src/main/resources/lib/form/hetero-list.jelly @@ -91,14 +91,13 @@ THE SOFTWARE. +
-
- diff --git a/core/src/main/resources/lib/form/hetero-radio.jelly b/core/src/main/resources/lib/form/hetero-radio.jelly index 027960f9f0..45eee1e302 100644 --- a/core/src/main/resources/lib/form/hetero-radio.jelly +++ b/core/src/main/resources/lib/form/hetero-radio.jelly @@ -47,11 +47,7 @@ THE SOFTWARE. - - - - - +