I've setup all the tokens and have debugged the module, it fails to display a post. The page in question is facebook.com/gundryconsultancy
So basically in the FacebookPostCollector the getPosts method has a do...while that should break when the url is null, but it's using OR instead of AND, and that fails. Test it. Replacing with && fixes this.
public function getPosts($page_name, $post_types, $num_posts = 10) {
$posts = [];
$post_count = 0;
$url = $page_name . $this->getFacebookFeedUrl($num_posts);
do {
$response = $this->facebook->get($url);
// Ensure not caught in an infinite loop if there's no next page.
$url = NULL;
if ($response->getHttpStatusCode() == Response::HTTP_OK) {
$data = json_decode($response->getBody(), TRUE);
$posts = array_merge($this->extractFacebookFeedData($post_types, $data['data']), $posts);
$post_count = count($posts);
if ($post_count < $num_posts && isset($data['paging']['next'])) {
$url = $data['paging']['next'];
}
}
} while ($post_count < $num_posts && NULL != $url);
return array_slice($posts, 0, $num_posts);
}
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | fix_single_post_collection-3117218-3.patch | 495 bytes | tyeth |
Comments
Comment #2
darchuletajr commentedMaybe I'm misunderstanding but did you need help with this or did you figure it out? Seems like you just need to make a patch.
Comment #3
tyeth commentedPatch attached. Thanks for taking a look.
Was hitting spam limit for everything I post or tried to edit. One said wait 2hours pfft! Had to wait twenty mins just for this one.
Comment #5
tyeth commentedComment #6
tyeth commentedHi, I closed this without checking clearly, the applied commit is for the user-token overrides, not the attached patch.
Comment #8
hemangi.gokhaleI get it, not it's included. Thanks for reminding me 👍