cesurapp / pd-user

Simple user management system for Symfony 5.
MIT License
24 stars 5 forks source link

[Symphony 5.2][PHP 8] Could not load type "": class does not exist. #13

Closed Mecanik closed 3 years ago

Mecanik commented 3 years ago

Fresh Symphony 5.2 project, PHP 8.0, installed latest module.

Login page shows OK, however Register and Password Reset pages do not work.

I followed your steps to integrate this. Do you have any advice ?

Symfony\Component\Form\Exception\InvalidArgumentException:
Could not load type "": class does not exist.

  at ...\vendor\symfony\form\FormRegistry.php:85
  at Symfony\Component\Form\FormRegistry->getType('')
     (...\vendor\symfony\form\FormFactory.php:52)
  at Symfony\Component\Form\FormFactory->createBuilder('', object(User), array('profile_class' => 'App\\Entity\\Profile'))
     (...\vendor\symfony\form\FormFactory.php:28)
  at Symfony\Component\Form\FormFactory->create('', object(User), array('profile_class' => 'App\\Entity\\Profile'))
     (...\vendor\symfony\framework-bundle\Controller\AbstractController.php:327)
  at Symfony\Bundle\FrameworkBundle\Controller\AbstractController->createForm('', object(User), array('profile_class' => 'App\\Entity\\Profile'))
     (...\vendor\appaydin\pd-user\Controller\SecurityController.php:89)
  at Pd\UserBundle\Controller\SecurityController->register(object(Request), object(TraceableEventDispatcher), object(DataCollectorTranslator), object(UserPasswordEncoder), object(Mailer))
     (...\vendor\symfony\http-kernel\HttpKernel.php:157)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (...\vendor\symfony\http-kernel\HttpKernel.php:79)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true)
     (...\vendor\symfony\http-kernel\Kernel.php:195)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request))
     (...\public\index.php:20)        
Mecanik commented 3 years ago

This is what I don't like in projects like this and developers like you, why make a half-baked documentation ?

Your problem is inside the README:

# config/packages/user.yaml

    register_type: ''
    resetting_type: ''

If you set those 2 values empty, the above error will trigger. I cannot even comprehend why you need this in the first place.

Nevertheless you should not post half-baked documentation so people wastes their time debugging your code.

-1.

Mecanik commented 3 years ago

And then, another problem...

Variable "form" does not exist.

After registration.

-1.