Open radoslawkoziol opened 9 years ago
Same problem here, except when I remove the lines from RegistrationManager.php as you suggested, the form is not performed after submit. Instead it shows the empty registration form again.
Any ideas how to fix this?
Well, found a solution by myself => need to check the request object for POST method, like so:
$request = $this->container->get('request');
if ($request->getMethod() == 'POST') {
$result = $this->controller->registerAction($request);
if ($result instanceof RedirectResponse) {
return $result;
}
}
Maybe some official could check this issue (wether this is really a bug or OP and I are doing something wrong) and commit the suggested change?
@greg-man could you open a PR with the fix and a test to cover it?
Too bad, as I dug further I found that the fix won't cover the problem fully. It still exists, when a form is submitted, but rejected for some constraints, e.g. duplicate email. Any ideas?
Weird, don't know why, but custom templates are working now as expected. Must have done something wrong, doesn't seem to be a bug at all.
Hi I found a problem,
Every register route loads wrong (default) tempate. I found that is caused by those lines in
RegistrationManager.php
$this->controller->registerAction($this->container->get('request'));
This renders default register form and prevents to run this:
That's because this in RegistrationController in FOSUserBundle if (null !== $event->getResponse()) { return $event->getResponse(); }
doesn't return null
When I delete wrong lines from RegistrationManager.php - everything works well.
Am I doing something wrong, or there is a bug?
Here is my config.yml
config.yml