sfMelodyPlugin
sfMelodyPlugin copied to clipboard
Fatal error: Call to undefined method Token::getAllStatuses()
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
Hi,
Did you inialize submodules and build model and db like said in the Readme ?
Maxime
I have a similar problem. What i do initialize after installing plugin? Can you write link to detailed installation readme?
Hello, you do have sfDoctrineOAuthPlugin installed/enabled (or sfPropelOAuthPlugin)? /config/ProjectConfiguration.class.php
Hi $ cat config/ProjectConfiguration.class.php ... $this->enablePlugins('sfMelodyPlugin'); $this->enablePlugins('sfPropelOAuthPlugin'); ...
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
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?
here's test project with this error https://github.com/sc0rp10/sfMelodyPluginPropelTestProject
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
Hi all,
The version on symfony website is very old and obsolete I think. Can you try with github versions ?
can you update version on symfony website?
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.