mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
[FIXED HUDSON-1793] JSONObject no longer is null in UserPropertyDecriptor.newInstance(StaplerRequest, JSONObject)
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@9819 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
5c44f2039b
commit
7dbdd4729c
2 files changed
+11
-2
No files matched your search
@@ -3,6 +3,7 @@ package hudson.model;
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import hudson.CopyOnWrite;
|
||||
import hudson.FeedAdapter;
|
||||
import hudson.StructuredForm;
|
||||
import hudson.Util;
|
||||
import hudson.XmlFile;
|
||||
import hudson.model.Descriptor.FormException;
|
||||
@@ -12,6 +13,8 @@ import hudson.security.Permission;
|
||||
import hudson.security.PermissionGroup;
|
||||
import hudson.util.RunList;
|
||||
import hudson.util.XStream2;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.acegisecurity.Authentication;
|
||||
import org.acegisecurity.providers.anonymous.AnonymousAuthenticationToken;
|
||||
import org.kohsuke.stapler.Stapler;
|
||||
@@ -356,9 +359,12 @@ public class User extends AbstractModelObject implements AccessControlled {
|
||||
fullName = req.getParameter("fullName");
|
||||
description = req.getParameter("description");
|
||||
|
||||
JSONObject json = StructuredForm.get(req);
|
||||
|
||||
List<UserProperty> props = new ArrayList<UserProperty>();
|
||||
int i=0;
|
||||
for (Descriptor<UserProperty> d : UserProperties.LIST) {
|
||||
UserProperty p = d.newInstance(req, null);
|
||||
UserProperty p = d.newInstance(req, json.getJSONObject("userProperty"+(i++)));
|
||||
p.setUser(this);
|
||||
props.add(p);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user