我有一个从git repo安装的现有应用程序并且知道他应该工作,但是在启动它时遇到问题。应用程序使用 fosuserbundle 我在登录/注册时遇到以下错误:
Undefined index: email in /var/www/relabld-old/website/vendor /doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php on line 1704
虽然我的用户类中存在电子邮件字段:
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Index;
use Doctrine\Common\Collections\ArrayCollection as ArrayCollection;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use Symfony\Component\Validator\Constraints as Assert;
use Relabld\CommonBundle\Entity\UserStatus;
use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList;
use Doctrine\Common\Collections\Criteria;
use Relabld\CommonBundle\Entity\ItemStatus;
use Relabld\CommonBundle\Validator\Constraints as CustomAssert;
/**
* @ORM\Entity(repositoryClass="Relabld\CommonBundle\Entity\UserRepository")
* @ORM\Table(name="fos_user", indexes={@ORM\Index(name="first_name_idx", columns={"firstName"}), @ORM\Index(name="last_name_idx", columns={"lastName"}) , @ORM\Index(name="full_name_idx", columns={"fullName"})} )
* @UniqueEntity(fields={"email"}, groups={"Registration","Basics"}, message="Email is already used")
* @UniqueEntity(fields={"username"}, groups={"Registration"})
* @ORM\HasLifecycleCallbacks
* @CustomAssert\CustomUser
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @var string
* @Assert\Email(
* message = "The email '{{ value }}' is not a valid email.",
* groups={"requestInvitation"}
* )
*/
protected $email;
...
这可能是什么原因?
答案 0 :(得分:1)
删除电子邮件字段,此字段已存在。