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
This commit is contained in:
Kevin Roast
2009-04-08 12:49:22 +00:00
parent 9444be11a4
commit 063f2df8b0

View File

@@ -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"