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

Fatal error: Call to undefined method Token::getAllStatuses() #55

Open
fantasyind opened this issue Jul 24, 2012 · 11 comments
Open

Fatal error: Call to undefined method Token::getAllStatuses() #55

fantasyind opened this issue Jul 24, 2012 · 11 comments

Comments

@fantasyind
Copy link

Hi,
i have a problem with the configuration of sfMelody.
When i insert this code into function executeIndex of my module
$this->getUser()->connect('linkedin');
i get this error
Fatal error: Call to undefined method Token::getAllStatuses()

I post my app.yml

melody:
create_user: false # create a new user if not logged when you connect to a service
redirect_register: false # you can redirect to a register form or anything else by specify
# a valid route like "@user_register"
linkedin:
key: xxxxxxxxxxxxxx
secret: xxxxxxxxxxxxxxxx
callback: @melody_linkedin # or absolute url

  provider: linkedin          #like google, facebook -optional if 'name' config key is the name of the provider
  request_token_url: https://api.linkedin.com/uas/oauth/requestToken      # override the url - for OAuth 1 implementation only
  request_auth_url: https://api.linkedin.com/uas/oauth/authorize
  access_token_url: https://api.linkedin.com/uas/oauth/accessToken

and my routing

melody_connect:
url: /connect
param: { module: sfMelody, action: connect }

melody_linkedin:
url: /melody/linkedin
param: { module: sfMelody, action: linkedin }

I don't understand what is wrong.

Can you help me please?

Thank you

alessandro

@chok
Copy link
Owner

chok commented Jul 29, 2012

Hi,

Did you inialize submodules and build model and db like said in the Readme ?

Maxime

@sc0rp10
Copy link

sc0rp10 commented Oct 19, 2012

I have a similar problem. What i do initialize after installing plugin? Can you write link to detailed installation readme?

@sglessard
Copy link

Hello, you do have sfDoctrineOAuthPlugin installed/enabled (or sfPropelOAuthPlugin)?
/config/ProjectConfiguration.class.php

@sc0rp10
Copy link

sc0rp10 commented Oct 19, 2012

Hi
$ cat config/ProjectConfiguration.class.php
...
$this->enablePlugins('sfMelodyPlugin');
$this->enablePlugins('sfPropelOAuthPlugin');
...

@sglessard
Copy link

I've never used sfPropelOAuthPlugin.

sfDoctrineOAuthPlugin needs sfDoctrineGuardPlugin and doctrine:build classes has to be run.
Doctrine's Readme has a bit more info than Propel ;)
https://github.com/chok/sfDoctrineOAuthPlugin/blob/master/README.md

Hope it helps

@sc0rp10
Copy link

sc0rp10 commented Oct 20, 2012

i do:

$ git reset --hard HEAD

$ git st
# On branch sfMelodyPlugin
nothing to commit (working directory clean)

$ ./symfony plugin:install sfPropelOAuthPlugin

>> sfSymfonyPluginManager Installation successful for plugin "sfPropelOAuthPlugin"

$ ./symfony propel:build-model
$ ./symfony propel:build-form
$ ./symfony propel:build-filter
$ ./symfony propel:build-sql

# add table "token" tables to MySQL

$ ./symfony cc

$ ./symfony plugin:install sfMelodyPlugin

$ cat apps/frontend/lib/myUser.class.php 
...
class myUser extends sfMelodyUser {

...


$ cat config/ProjectConfiguration.class.php 
...
    $this->enablePlugins('sfPropelOAuthPlugin');
    $this->enablePlugins('sfMelodyPlugin');
...


$ cat apps/frontend/config/settings.yml 
...
    enabled_modules:        [default, sfGuardAuth, sfGuardGroup, sfGuardUser, sfGuardPermission, sfGuardForgotPassword, sfGuardRegister, sfMelodyPlugin]
...

What i do wrong?

@sc0rp10
Copy link

sc0rp10 commented Oct 21, 2012

here's test project with this error
https://github.com/sc0rp10/sfMelodyPluginPropelTestProject

@sglessard
Copy link

Hello,

Like I said I havent used sfPropelOAuthPlugin. Is your error "Call to undefined method Token::getAllStatuses "?
I looked at the plugin files inside sfMelodyPluginPropelTestProject and can't see the method getAllStatuses in Token class

// (DocumentRoot)/plugins/sfPropelOAuthPlugin/lib/model/Token.php

public static function getAllStatuses()
{
    return array(self::STATUS_REQUEST, self::STATUS_ACCESS);
}

See https://github.com/chok/sfPropelOAuthPlugin/blob/master/lib/model/Token.php

@chok
Copy link
Owner

chok commented Oct 22, 2012

Hi all,

The version on symfony website is very old and obsolete I think. Can you try with github versions ?

@sc0rp10
Copy link

sc0rp10 commented Oct 22, 2012

can you update version on symfony website?

@chok
Copy link
Owner

chok commented Oct 27, 2012

Not a lot of time now.

But you can just clone the project and remove the".git", you've got the same result as using pear from symfony.

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

4 participants