This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

model has to "User" relation. -> wtf?????

Questions relating to sfGuardPlugin or other user management plugins

model has to "User" relation. -> wtf?????

by Mathias » Thu Jul 07, 2011 2:34 pm

I try to doctrine:generete a module from a child of sfGuardUser. I get:

The "sfGuardUserChild" model has to "User" relation.


WTF does this even mean????

This is what the sfGuardUserChild class looks like:

Code: Select all
class sfGuardUserChild extends sfGuardUser {
    //put your code here
}
Mathias
Member
 
Posts: 85
Joined: Thu May 26, 2011 4:45 pm

Re: model has to "User" relation. -> wtf?????

by Mathias » Thu Jul 07, 2011 3:08 pm

Found out, that

model has to "User" relation
should read
model has no "User" relation
.

you find it in the sfFormDoctrine.class.php

Code: Select all
  protected function getRelatedModelName($alias)
  {
    $table = Doctrine_Core::getTable($this->getModelName());

    /*if (!$table->hasRelation($alias))
    {
      throw new InvalidArgumentException(sprintf('The "%s" model has no "%s" relation.', $this->getModelName(), $alias));
    }*/

    $relation = $table->getRelation($alias);

    return $relation['class'];
  }
}


As you can see, I've corrected and commented out the shitty bug-report. Now I get:

Unknown relation alias User


Any help?
Mathias
Member
 
Posts: 85
Joined: Thu May 26, 2011 4:45 pm