mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 14:02:22 +00:00
[FIXED ISSUE-1913]
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10330 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
6a7473ef1e
commit
f3ee22c42f
1 file changed
+12
-3
@@ -1587,10 +1587,19 @@ public final class Hudson extends View implements ItemGroup<TopLevelItem>, Node,
|
||||
throws FormException {
|
||||
|
||||
if(!j.has(name + "Class")) return null;
|
||||
final String clazz = j.getString(name + "Class");
|
||||
final JSONObject data = j.getJSONObject(name);
|
||||
|
||||
// work around ISSUE-1913... the nesting has changed in dropDownList
|
||||
|
||||
final Object container = j.get(name + "Class");
|
||||
j.remove(name + "Class");
|
||||
j.remove(name);
|
||||
|
||||
final String clazz = container instanceof JSONArray
|
||||
? ((JSONArray) container).getString(0)
|
||||
: (String) container;
|
||||
final JSONObject data = container instanceof JSONArray
|
||||
? ((JSONArray)container).getJSONObject(1).getJSONObject(name)
|
||||
: null;
|
||||
|
||||
for (Descriptor<T> d: descriptors) {
|
||||
if (d.getClass().getName().equals(clazz)) {
|
||||
return d.newInstance(req, data);
|
||||
|
||||
Reference in new issue
Block a user