If you start getting errors, such as:

Failed to query https://graph.facebook.com/1538405319747208/feed. Bad Request: (#283) Requires extended permission: manage_pages OAuthException 283 (http 400)
===
(#283) Requires extended permission: manage_pages
(#200) Requires extended permission
(#200) The user hasn’t authorized the application to perform this action

The module works as designed (support api 2.1). But Facebook moves everybody to the API 2.3 on April 30, 2015.

P.S. It doesn't post nodes to FB page, but post to account without any errors. Someone has some errors while posting nodes to FB pages?

Comments

xcono’s picture

Issue summary: View changes
xcono’s picture

Issue summary: View changes
ladybug_3777’s picture

We had a client report this error this morning. Why is this issue marked as closed (works as designed)? Are you saying this Drupal module will no longer work with the new API? I can't image that's by design.

xcono’s picture

Because it's realy "work as designed". Docs says it's based in 2.1 api.
I have a test patch for this issue, but have no ability to check it right now.

ladybug_3777’s picture

Well if the API is changed then this module also needs to be updated or else it's worthless. If anything this should be posted as an Active bug so people can easily find the issue and create a patch.

If you have a patch I can test it for you.

ladybug_3777’s picture

Status: Closed (works as designed) » Active
xcono’s picture

StatusFileSize
new1.58 KB

The problem, i think, about changes in 2.3.
It's changes in scopes (publish_actions to publish_pages)

https://developers.facebook.com/docs/apps/changelog#v2_3_changes

ladybug_3777’s picture

This look similar to the issue we ran into last July when Facebook changed their API. https://www.drupal.org/node/2311269

You may want to compare that older patch with yours to make sure you have all the areas changed. Also please post your patch with the proper Drupal patch naming convention so it can be tracked easier.

[project_name]-[short_description]-[issue_number]-[comment_number].patch

xcono’s picture

Yes, it is. I couldn't find your patch.
Thank you very much! I think, it's time to mark my issue as duplicated.

ladybug_3777’s picture

No my patch is OLD, it doesn't include publish_pages. My patch was for version 2.0 and included the old publish_actions permissions. I think yours is still valid.

I don't have time this moment to test it, but from the quick look I did you are on the right path with the fix. I will test yours as soon as I have a free moment.

ladybug_3777’s picture

I've re-rolled your patch with the correct naming convention and I also updated another section that was still calling the publish_action permissions.

I've tested this patch locally and it seems to work well so far.

ladybug_3777’s picture

Here's something interesting from the Facebook 2.3 API pages:

People who granted manage_pages and publish_actions before v2.3 have automatically been granted publish_pages

According to this, anyone that set up their application/token with the committed patch I created back in July (https://www.drupal.org/node/2311269) should have been OK because they would have been granted publish_pages already. However our client (which did have my older patch) did see this error and when debugging their token, they do indeed show publish_pages as a granted permission so I wouldn't expect this error to have occurred. I'm having trouble recreating the error on my staging server since my older tokens were expired and I created new ones.

A few things to test PRIOR to applying this new patch:

1) Go to Configuration->Facebook->Settings->Token.
2) Select "Do not use saved token" and click save. It should say "No token chosen" after you do that.
3) Now click the link to "Generate new token via yourAppNameHere". When that page refreshes you will see "Generated a new access token, but not yet saved. Remember to press the submit button." Click the "Save default token" button to save it.

Now see if that is enough to get the post to work for you again.

You can also go to the tokens management page in your Drupal site and click the "Debug" button. See if your token has "publish_pages" listed in the scope section.

If that does not work, you may need to apply the new patch, set up a new app on facebook with the new API and replace your existing app with the new one. To do that you must clear your token, and delete your existing app. Create the new app on FB, add it to Drupal, then generate a new token for it. That may get things working for you as well. The Drupal module can be buggy with deleting items so I usually follow these steps to do it:

1) Go to Configuration->Facebook->Settings->Token.
2) Select "Do not use saved token" and click save. It should say "No token chosen" after you do that.
3) Go the Configuration->Facebook->Applications
4) Click the "edit" link and when the next page loads click the "Delete Application" button.

~~~ Make sure you apply the new patch here, and clear your cache to be safe ~~~

Now hop over to http://www.facebook.com/developers and create your new app. (My Apps -> Add a new app) Once it's set up you'll have App ID and App Secret keys to add to Drupal. To get it into Drupal follow these steps:

1) Configuration->Facebook->Applications->Add Application
2) Plugin your App id and Secret. Select "Default application" and "Enabled" and then save
3) Configure your site wide token at Configuration->Facebook->Settings->Token
4) Click the link to "Generate new token via yourAppNameHere". When that page refreshes you will see "Generated a new access token, but not yet saved. Remember to press the submit button." Click the "Save default token" button to save it.

Now test publishing content from Drupal to Facebook again and see if it works.

I'll have my client try a few of these options as well and I'll let you know what we find.

ladybug_3777’s picture

Update:
My client was able to generate a new token (without applying this patch) and things are working for him again.

I do believe this patch will be needed to handle the new "publish_pages" permission, but the fact that Facebook has said

People who granted manage_pages and publish_actions before v2.3 have automatically been granted publish_pages

means that it will still support the old permission configuration for a while too.

ladybug_3777’s picture

Status: Active » Needs review

Updating to needs review so this patch can be looked at by others.

xcono’s picture