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);
  }
CommentFileSizeAuthor
#3 fix_single_post_collection-3117218-3.patch495 bytestyeth

Comments

tyeth created an issue. See original summary.

darchuletajr’s picture

Maybe 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.

tyeth’s picture

StatusFileSize
new495 bytes

Patch 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.

  • Hemangi Gokhale committed b9b094f on 8.x-1.x
    Issue #3117218 by tyeth: Single test post on Business Page doesn't...
tyeth’s picture

Status: Active » Fixed
tyeth’s picture

Status: Fixed » Needs work

Hi, I closed this without checking clearly, the applied commit is for the user-token overrides, not the attached patch.

  • b1175d6 committed on 8.x-1.x
    Issue #3127876 by tyeth: FB: Error with newly installed and patched v8,...
hemangi.gokhale’s picture

Status: Needs work » Fixed

I get it, not it's included. Thanks for reminding me 👍

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.