Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook | Undefined property #59

Open
willian-pestana opened this issue Jan 19, 2013 · 2 comments
Open

Facebook | Undefined property #59

willian-pestana opened this issue Jan 19, 2013 · 2 comments

Comments

@willian-pestana
Copy link

Hello!

I want to use this great plugin, but i'm having problems with it.

After I login on facebook, I go to a page that shows my facebook data, but I get this error and no data whatsoever (my name, friends, etc).

Hello Notice: Undefined property: stdClass::$first_name in /lib/vendor/symfony/lib/escaper/sfOutputEscaper.class.php on line 241 Notice: Undefined property: stdClass::$link in /lib/vendor/symfony/lib/escaper/sfOutputEscaper.class.php on line 241 Warning: array_merge(): Argument #2 is not an array in /lib/vendor/symfony/lib/helper/UrlHelper.php on line 81 Notice: Trying to get property of non-object in /lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/routing/sfDoctrineRoute.class.php on line 132 Notice: Trying to get property of non-object in //lib/vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/routing/sfDoctrineRoute.class.php on line 132

I have no ideia what is happening. Could you guys help me out, please?

@sglessard
Copy link

I havent used facebook melody, you sure you are logged in?
How do you call ->first_name ?

@willian-pestana
Copy link
Author

I figured out what was happening.

$this->me = $this->getUser()->getMelody('facebook')->getMe();
$this->friends = $this->getUser()->getMelody('facebook')->getFriends(array('friends' => 'me/friends'));

In the first line, I forgot to put the "getUser()" and in the second line I didn't put "array('friends' => 'me/friends')". Was just a newbie mistake. Now it works like a charm.

On the template, I put an echo $me->first_name or whatever data I want. 👍 The friends list is working flawlessly too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants