Mark-H / SocialSuite

[unsupported] SocialSuite is a collection of snippets and other useful tools to integrate social media with your MODX Revolution website.
4 stars 1 forks source link

[SocialSuite/getFacebookPhotos] Error retrieving information about the user #1

Open matdave opened 9 years ago

matdave commented 9 years ago

Suddenly getting a new error

[2015-07-15 08:54:02] (ERROR @ /index.php) [SocialSuite/getFacebookPhotos] Could not retrieve info about user XXXXXX | Information: Array
(
    [error] => Array
        (
            [message] => An access token is required to request this resource.
            [type] => OAuthException
            [code] => 104
        )

)
scottpureds commented 9 years ago

Also having the same issue... Please help us out, you've got a great extra here!!!

matdave commented 9 years ago

@scottpureds my fix was creating an "App" in facebook, then using the App ID and App Secret to validate the requests. Then around line 126 of core/components/socialsuite/model/socialsuite.class.php I changed it to.

    public function simpleCurlRequest($url = '', $post = '') {
        if (empty($url)) { return array('error' => '[SocialSuite] URL not specified.'); }
        $ch = curl_init();
        // Set URL to download
        if(strpos($url,"?") === false){
            $url = $url."?&access_token=appid|appsecret";
        }else{
            $url = $url."&access_token=appid|appsecret";
        }

Make sure to include the pipe between your App ID and App Secret