GithubHelp home page GithubHelp logo

Comments (4)

ro0NL avatar ro0NL commented on June 1, 2024

@crabnky

Call to a member function getId() on null

Do you have a stacktrace? Some code would be nice too :)

from symfony-demo-app.

crabnky avatar crabnky commented on June 1, 2024

Stack Trace:

Error:
Call to a member function getId() on null

  at src\Controller\Contact\ForgotPasswordController.php:38
  at App\Controller\Contact\ForgotPasswordController->__invoke(object(Request), object(FormFactory), object(FlashBag), object(TraceableMessageBus), object(EntityManager))
     (vendor\symfony\http-kernel\HttpKernel.php:149)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor\symfony\http-kernel\HttpKernel.php:66)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (vendor\symfony\http-kernel\Kernel.php:188)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (public\index.php:37)

exception
logs

Let me know if you need enything else.

from symfony-demo-app.

ro0NL avatar ro0NL commented on June 1, 2024

You're not getting an entity from doctrine based on given email, $user is null. Not sure why you call the User entity a Contact.. but that shouldnt matter.

If you want to find a user by either primary or secondary email (or any of the lookups configured under msgphp_user.username_lookup), you'll need to use UserRepositoryInterface::findByUsername or handle the case your self.

See e.g. https://github.com/msgphp/symfony-demo-app/blob/master/src/Controller/User/ForgotPasswordController.php#L26

from symfony-demo-app.

crabnky avatar crabnky commented on June 1, 2024

Uhhhhhh, sure, fool me. :|
Let's assume this issue was never raised. :))
About Contacts - I have to work on existing database and I have limited ability to modify it, so I have to work with already existing solutions. I'm not a fan of many of them, but... it is what it is. :(

from symfony-demo-app.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.