This issue has two parts:

Part 1:
When I remove the Facebook Application from my Facebook account while I am logged in Drupal then Drupal Crashes for me and shows the following error:

Error
<br>
The website encountered an unexpected error. Please try again later.

Error message
<br>
FacebookApiException: Invalid OAuth 2.0 Access Token in Facebook->_restserver() (line 515 of /[i_removed_path]sites/all/modules/facebook_stream/facebook-php-sdk/src/facebook.php).

I had to logout so to not see this error again. But it has Session Expired in Block. What else do I need to do so to stop associating my account with Facebook? (This question is the Part 2)

Comments

zandros’s picture

The <br>in error is not displayed in the screen, I have typed in here by mistake

Gravedigger’s picture

Before uninstalling this plugin first you need to remove the api id and key and than uninstall, hope this will help.

marksward’s picture

Exception is being thrown at:

FacebookApiException: User must have accepted TOS in BaseFacebook->throwAPIException() (line 1106 of [myinstalldir]/sites/all/modules/facebook_stream/facebook-php-sdk/src/base_facebook.php).

Which is kind of valid, but the module needs to gracefully handle it - I still allow page rendering normally, but perhaps shown message in the Facebook block

marksward’s picture

putting try catch around the $block['content'] = _get_facebook_stream(); (approx line 355 in facebook_stream.module) lets you handle it more gracefully.

It appears the exception can occur if the user removes the app in Facebook whilst still in the Drupal site; removes the permisisons the module needs as part of the Facebook auth setup or have also seen it when the user selected 'deny' in the auth process