From 063f2df8b077ff2a9984481bdf033ce4f209eeae Mon Sep 17 00:00:00 2001 From: Kevin Roast Date: Wed, 8 Apr 2009 12:49:22 +0000 Subject: [PATCH] Fix to painfully broken PeoplePut REST API implementation. - it was hilariously passing a Script object directly into a Template model - useful. - due to some recent changes the template model was finally being used in the person PUT template so this long-standing bug was triggered git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13901 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../java/org/alfresco/repo/web/scripts/person/PersonPut.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/repo/web/scripts/person/PersonPut.java b/source/java/org/alfresco/repo/web/scripts/person/PersonPut.java index 149018b4b7..e6d8cde727 100644 --- a/source/java/org/alfresco/repo/web/scripts/person/PersonPut.java +++ b/source/java/org/alfresco/repo/web/scripts/person/PersonPut.java @@ -29,11 +29,11 @@ import java.util.HashMap; import java.util.Map; import org.alfresco.model.ContentModel; -import org.alfresco.repo.jscript.ScriptNode; import org.alfresco.repo.security.authentication.AuthenticationComponent; import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; import org.alfresco.repo.security.permissions.AccessDeniedException; +import org.alfresco.repo.template.TemplateNode; import org.alfresco.service.ServiceRegistry; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeService; @@ -198,7 +198,7 @@ public class PersonPut extends DeclarativeWebScript updatePersonPropertiesWorker, this.authenticationComponent.getSystemUserName()); // Put the updated person on the model to pass to the template - model.put(MODEL_PROP_KEY_PERSON, new ScriptNode(updatedPerson, this.serviceRegistry)); + model.put(MODEL_PROP_KEY_PERSON, new TemplateNode(updatedPerson, this.serviceRegistry, null)); } // else if no person was found matching the given user name, // then return HTTP error status "not found"