Pemenant page token not changed when required

Created on 21 April 2020, over 5 years ago
Updated 14 August 2025, 28 days ago

The token supplied by user configuration is a user access token, this is combined with the page name to obtain a permenant page acess token. The fcebook client uses this if set instead of any newly supplied main socialfeed configuration or block override app id secret and user token.

Basically the permenant page token is never cleared, no matter what. It should also be ignored in the case of block override values app id/secret or user token varying from main config.

My original setup was a new app with myself as admin and a new business page to test with. I obtain a long lived user access token and supply main socialfeed config.
I setup a facebook block on a secondary page. It displays as expected. I customize the feed/block and leave all settings but change post count. Works as expected.
I add an admin to my facebook app (client and manager of clients business page), and i get their long lived user token.
I enter client page name and client token in the main socialfeed settings, the block remains unchanged as expected (customised to my old token).
I then edit the block and untick the override/customize-feed option and clear cache as usual. The world begins to fall apart...depending on my settings I can see the block in view mode but not in layout mode...mainly in part due to placing my now erroring block with layout designer but still I'd love it to fail gracefully.

Setting the page name back to mine and putting in a valid token for mine works again but only my original test page.

Messing around I set the clients info again and i poked the debugger to edit the config value for permenant page token to one I obtained from the /access endpoint, which worked. I also tried just clearing the permenant page token which also worked to get the clients posts. The only remaining problen is how to best get the customised blocks to ignore or have their own permenant page token.

My initial patch was going to be to check for change of app id, secret or token and then clear permenant page token, but id like to also cater for the customised blocks.

Thoughts welcomed...

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom tyeth

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India shalini_jha

    I am also facing the same issue , the Permanent token is not refreshing after changing the configuration more then one time.
    Means if permanent token is generated and saved in config so based on the current condition it will not refresh based on the latest page feed value.
    Hence moving this in active status.

  • 🇮🇳India shalini_jha

    shalini_jha changed the visibility of the branch 3129570-pemenant-page-token to hidden.

  • 🇮🇳India shalini_jha

    Hi,

    I’ve raised a PR to update the Facebook permanent token whenever required.
    The update is triggered in these cases:

    When the default config or a domain-specific config override is changed.

    When editing a config, if the "Override permanent token" checkbox is checked.

    For edits, this new "Override permanent token" field must be checked if you want the permanent token to be regenerated. After the token is refreshed, the field is automatically set back to false so that the token is not regenerated on every save.

    Please review this and let me know if anything needs to update : https://git.drupalcode.org/project/socialfeed/-/merge_requests/20

Production build 0.71.5 2024