Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is no property count in current graph api response. At least I didnt find a way to produce this in the response. So I am assuming that $entry->likes->count
is obsolete.
Instead I would use count($entry->likes->data)
to get the like count. Same for comments.
EDIT: This is not going to work afterall, cause the likes will be paged. It would work if you set the like limit to a number that could never be reached, but thats not a very good option when there are hundreds of thousands of likes.
Comment | File | Size | Author |
---|---|---|---|
#3 | like_and_comment_count-2241487-3.patch | 1.05 KB | lolandese |
Comments
Comment #1
Martin. CreditAttribution: Martin. commentedComment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedwhat fields should I create for the likes to link to? Should I create an integer field?
Comment #3
lolandese CreditAttribution: lolandese commentedThe solution is twofold: