Topic-icon EasyBlog Autopost 400 errors

7 years 9 months ago #58862 by adammelcher
Love this extension and all the the things I have been able to do with it! I believe there is a bug in the Easyblog autopost function as I am sure when it was created, the autopost function most likely is based on when the blog is created then autopost to various social networks, however on our site, the administrator must approve the blog before it is posted publicly and I think that is the reason the blog posts are getting 400 errors in twitter and facebook (it's still posting the blog before it's approved but can't access the actual blog)... Is there a way the autopost can be called when the blog is approved versus when it's created (providing that's the cause of it). If you can't recreate the blog issue on your end, let me know and I will send you my login credentials... Thanks,

Adam
The topic has been locked.
Support Specialist
7 years 9 months ago #58869 by alzander
Right now, we check if the article is published and if the publish date has already passed. That accounts for articles that are set to published, but not visible yet.

I haven't checked out the administrator publishing options. Can you explain that workflow and how the values are set before and after publishing the article? Also, what version of EB are you using?

Thanks,
Alex
The topic has been locked.
7 years 9 months ago #58877 by adammelcher
Alex,

I am using the latest versions of both jfbc and easyblog (7.0.2 & 5.0.36 respectively). We have a large community (jomsocial) and so in order to not let the users abuse the blog feature, we allow them to post a new blog, but an administrator has to approve it before it gets published. To help you find the exact settings we use:

1. in the easyblog administrator dashboard > ACL (then registered for us)
2. Allowed to Write New Post [YES], Allowed to Publish Post [NO] (all the rest of the settings following this one are set to [NO] as well.

Right now, everytime a user writes a new blog, it is posted but not published until the administrator approves it , but in the mean time, it is being autoposted to Twitter and Facebook with a 400 error since it's blocked from anybody besides an administrator from seeing it.

If you could set the jfbc component check if the post must be approved first and then if so, check that it was approved before calling the autopost function (if it doesn't need administrator approval then it would default to the existing actions), I think it would have this resolved?
The topic has been locked.
Support Specialist
7 years 9 months ago #58892 by alzander
Sorry for the delayed response. We needed to a bit more investigation with your admin approval setup. That's not something we had tested before, but I think we have an easy fix for you to try.

Please open the /plugins/opengraph/easyblog/easyblog.php file. At line 496, you'll see:
$isPending = $this->isArticlePublishPending($article->publish_up);
Update that to:
$isPending = $this->isArticlePublishPending($article->publish_up) || ($article->published == 4);

Then, at line 525, you'll see something similar:
$isPending = $this->isArticlePublishPending($blog->publish_up);
Update that to:
$isPending = $this->isArticlePublishPending($blog->publish_up) || ($article->published == 4);

That should properly hide the article until the published state goes to the approved state. Please keep us posted on how that goes. We'll continue further investigation and plan to implement this in the next release of JFBConnect.

Thanks,
Alex
The topic has been locked.