sfMelodyPlugin icon indicating copy to clipboard operation
sfMelodyPlugin copied to clipboard

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

Open fantasyind opened this issue 12 years ago • 11 comments

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

fantasyind avatar Jul 24 '12 14:07 fantasyind

Hi,

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

Maxime

chok avatar Jul 29 '12 12:07 chok

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

sc0rp10 avatar Oct 19 '12 07:10 sc0rp10

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

sglessard avatar Oct 19 '12 13:10 sglessard

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

sc0rp10 avatar Oct 19 '12 13:10 sc0rp10

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

sglessard avatar Oct 19 '12 13:10 sglessard

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 avatar Oct 20 '12 22:10 sc0rp10

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

sc0rp10 avatar Oct 21 '12 00:10 sc0rp10

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

sglessard avatar Oct 22 '12 12:10 sglessard

Hi all,

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

chok avatar Oct 22 '12 12:10 chok

can you update version on symfony website?

sc0rp10 avatar Oct 22 '12 13:10 sc0rp10

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.

chok avatar Oct 27 '12 09:10 chok