webtechnick / CakePHP-Facebook-Plugin

CakePHP Facebook Plugin
http://facebook.webtechnick.com
444 stars 138 forks source link

FB::api('/me') doesn't work ? #48

Open ousmaneo opened 12 years ago

ousmaneo commented 12 years ago

Hi i'm getting php warning when trying to access to the facebook api :

Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object [APP/Plugin/facebook/Lib/FB.php, line 58]

and the FB::api('/me') call doesn't show any result ? Any help well be great !!!! Thanks

ghost commented 12 years ago

Have you included the App::uses('FB', 'Facebook.Lib'); in your controller?

simonbuehler commented 12 years ago

same here , latest git and php 5.3, cake 2, any idea?

simonbuehler commented 12 years ago

5.3.10-pl0-gentoo via FPM/FastCGI fails with FB::api('/me') but $Facebook = new FB(); $fbsession= $Facebook->api('/me');

works, strange ... any fix?

jeffersonrbr commented 12 years ago

i am having the same problem, when i put the component 'Facebook.Connect" i have this warning:

Warning (2): call_user_func_array() expects parameter 1 to be a valid callback, class 'Facebook' does not have a method 'getSession' [APP/Plugin/Facebook/Lib/FB.php, line 34]

anybody has fixed?

PMoser commented 12 years ago

Facebook has changed the name of the API method getSession to getUser. It's ridiculous they cant provide an alias for backward compatibility, so both calls work. They just changed the method's name and broke thousands of apps by doing that. Not so nice developer treatment. Anyway you have to change the method name getSession to getUser. Don't know where exactly this method is called throughout the plugin, but should be fixed if you just search for all this calls in your plugin and replace the name to getUser.