Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error after composer update #556

Closed
bnd170 opened this issue May 24, 2015 · 2 comments
Closed

Error after composer update #556

bnd170 opened this issue May 24, 2015 · 2 comments

Comments

@bnd170
Copy link

bnd170 commented May 24, 2015

I made a project using Sonata Package with admin, media... user too implemeted with FOSUser.

I create a custom User Entity following your doc and before today's update it works fine.

Now my website throws me an 500 Internal Server Error and my php logger shows me this error:

Call to a member function getUser() on a non-object in vendors\sonata-project\user-bundle\Controller\SecurityFOSUser1Controller.php on line 29

The lane is:

    $user = $this->container->get('security.context')->getToken()->getUser();

I think it happen when I try to open some controller that uses an entity linked to the user entity.

/**
 * @ORM\ManyToOne(targetEntity="\Application\Sonata\UserBundle\Entity\User")
 * @ORM\JoinColumn(name="author_id", referencedColumnName="id")
 */
private $user;

It doesnt throw me an error but the relation doesnt work in DB.

@OskarStark
Copy link
Member

can you rollback to the version of SonataUserBundle before and try again?

what does doctrine:mapping:info say?

@jordisala1991
Copy link
Member

Closing, not enough info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants