Whats the difference between the DefaultLikeManagers getLikes and the countLikes?
To my understanding the countLikes function should return the size of the list returned by the getLikes function but the following code produces different results.
int likeListCount = likeManager.getLikes(contentItem).size(); // 0 int likeCount = likeManager.countLikes(contentItem); // 2
The documentation is not really clear about this but it suggests it should be the same.
Community moderators have prevented the ability to post new answers.
My expectation is that they should return the same. Only guess (although it's not stated in the docs) is that the countLikes iterates through child objects. Also to bu sure try to re-index the content.
Thank you for the tip about reindexing, sadly this does not fix the issue.
The object I'm testing on is a page with 2 likes and no comments so it should not matter if it is iterative.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.