Skip to content

Commit

Permalink
Fix for issues #146 (#147)
Browse files Browse the repository at this point in the history
* Fix in response return

Without this fix only RedirectResponse can be returned. In my project I send response by JsonRespons and I had to make this fix.
  • Loading branch information
padalec authored and garak committed Apr 28, 2017
1 parent 725b2c5 commit 98efd78
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Controller/RegistrationManager.php
Expand Up @@ -5,7 +5,7 @@
use PUGX\MultiUserBundle\Model\UserDiscriminator;
use Symfony\Component\DependencyInjection\ContainerInterface;
use FOS\UserBundle\Controller\RegistrationController;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
use PUGX\MultiUserBundle\Form\FormFactory;

class RegistrationManager
Expand Down Expand Up @@ -50,14 +50,14 @@ public function __construct(UserDiscriminator $userDiscriminator,
/**
* @param string $class
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse
* @return \Symfony\Component\HttpFoundation\Response
*/
public function register($class)
{
$this->userDiscriminator->setClass($class);
$this->controller->setContainer($this->container);
$result = $this->controller->registerAction($this->getRequest());
if ($result instanceof RedirectResponse) {
if ($result instanceof Response) {
return $result;
}

Expand Down

3 comments on commit 98efd78

@ldesmeules
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit cause bug, can't override default registration template : Issue #151

@AlterB
Copy link

@AlterB AlterB commented on 98efd78 Jul 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The override problem is caused by this commit. Issue #151.
I quote @ldesmeules !

@Ardinis
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works very well after reverting this commit.

Please sign in to comment.