johnnyhowey/liferay-plugins — pull request #197 by epgarcia (2012-10-15 15:38:30+00:00)
Title: SOS-1195 User is unable to export a vCard if a contact is flagged

Hey Jon,

We were using the relationAction function for exporting vCards when one or more users in the user list of the contacts center portlet were selected. This is not correct, since the relationAction function is designed for actionRequests and not for resourceRequests.

After a successful request, the relationAction function used the data from the response to check the previously selected users. In the case of a resourceRequest (as for exportVCards), the response did not contain the expected data and we got a Javascript error at that point.

I changed it so that the resource URL is opened with location.href in both cases (with or without users checked in the user list), with the corresponding id. Please check the way in which the userIds param is appended to the resourceURL. We have to do it with javascript, but I don't know if there is a better way.

I also changed the order of the when-otherwise block for consistency with the rest of the code (check user2 !=null first).

Thanks

@ealonso
@ipeychev