Archive for August, 2009
Symfony Tip: Admin Generator + sfGuardPlugin + SfGuard Profile
5th
August
2009
Posted by James Beattie - under News 1 Comment

If you get the error “Call to undefined method BasesfGuardUser::addsfGuardUserProfile” when using a custom sfGuardUser profile, you need to add the following method to the file /plugins/sfGuardPlugin/lib/model/sfGuardUser.php
public function addsfGuardUserProfile()
{
if(!$profile = $this->getProfile())
{
$profile = new sfGuardUserProfile;
$profile->setUserId($this->getId());
}
return $profile;
}
I know it sucks to hack a core plugin file, but sometimes we must pragmatic!