Message Boards

getUsers return empty result

Jason Chee, modified 3 Years ago.

getUsers return empty result

Junior Member Posts: 52 Join Date: 9/24/18 Recent Posts
Hi all. I've recently downloaded a plugin from Marketplace that I really wanted to use in my project, but the developer for that plugin is not responding to my questions. I'm trying to debug it on my own but I have a pretty limited experience with Liferay APIs.
There's a getUsers function in his plugin that works totally fine on a clean copy of Liferay. However, when I deploy the same plugin into my project, the same function returns empty result (but the ajax call is considered success). The difference between my project and a clean installation of Liferay is that mine has LDAP already set up. I'm not sure if this somehow causes the getUsers to return empty result.
Below is a snippet of the code:

function getUsers(){
    var url = "<%= getUsers.toString() %>";
    if(url != 'undefined'){
        $.ajax({
			url : url,
			type: "POST",
			async: false,
			contentType:  false,
			processData: false,
			success: function(res){
			    var data = $.parseJSON(res);
			    userProfiles = data._jsonObject.map.userPortrait;
			},
			error: function(XMLHttpRequest, textStatus,errorThrown){
				console.log('errorThrown = ' + errorThrown);
				console.log('textStatus = ' + textStatus);
				console.log('XMLHttpRequest = ' + XMLHttpRequest);
			}
		});
	}
}

If anyone could point me to the right direction, I would really appreciate it! Thank you.