1

Sorry if my english in't very good. I'm learning it.

I have followed all the steps of the instalation guide of PUGXMultiUserBundle. The only thing i haven`t done is to create the forms for my entities. I'm confused about it.

When I go to the register page for my user-one, it says this to me:

Catchable Fatal Error: Argument 1 passed to FOS\UserBundle\Doctrine\UserManager::__construct() must implement interface Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface, instance of FOS\UserBundle\Util\PasswordUpdater given, called in C:\xampp\htdocs\myproject\vendor\pugx\multi-user-bundle\Doctrine\UserManager.php on line 44 and defined

Code of PUGXMultiUserBundle's User Manager:

// vendor\pugx\multi-user-bundle\Doctrine\UserManager.php (function __construct)

 public function __construct(PasswordUpdaterInterface $passwordUpdater, CanonicalFieldsUpdater $canonicalFieldsUpdater, ObjectManager $om, $class, UserDiscriminator $userDiscriminator)
    {
        $this->om = $om;
        $this->userDiscriminator = $userDiscriminator;

        parent::__construct($passwordUpdater, $canonicalFieldsUpdater, $om, $class);
    }

Code of FOSUserBundle's User Manager:

// vendor\friendsofsymfony\user-bundle\Doctrine\UserManager.php (function __construct)

public function __construct(EncoderFactoryInterface $encoderFactory, CanonicalizerInterface $usernameCanonicalizer, CanonicalizerInterface $emailCanonicalizer, ObjectManager $om, $class)
    {
        parent::__construct($encoderFactory, $usernameCanonicalizer, $emailCanonicalizer);

        $this->objectManager = $om;
        $this->repository = $om->getRepository($class);

        $metadata = $om->getClassMetadata($class);
        $this->class = $metadata->getName();
    }
Federkun
  • 36,084
  • 8
  • 78
  • 90
Brjtr
  • 157
  • 4
  • 17
  • Which is the line 44 in pugx\multi-user-bundle\Doctrine\UserManager.php ? – jean-max Dec 12 '16 at 10:44
  • In the file `pugx\multi-user-bundle\Doctrine\UserManager.php` you give the first parameter to `parent::_construct` as an `PasswordUpdaterInterface` instance variable instead of an `EncoderFactoryInterface` instance var. I hope you understand what I mean – jean-max Dec 12 '16 at 10:48
  • I tried it before, but if I substitute the params of the PUGXMultiUserBundle's __construct function with the params of FOSUsersBundle's __construct function, it says this to me: **Catchable Fatal Error: Argument 1 passed to PUGX\MultiUserBundle\Doctrine\UserManager::__construct() must be an instance of PUGX\MultiUserBundle\Doctrine\EncoderFactoryInterface, instance of FOS\UserBundle\Util\PasswordUpdater given, called in C:\xampp\htdocs\CASPruebas\app\cache\dev\appDevDebugProjectContainer.php on line 2197 and defined** – Brjtr Dec 12 '16 at 11:07
  • line 44 is that: `parent::__construct($passwordUpdater, $canonicalFieldsUpdater, $om, $class);` – Brjtr Dec 12 '16 at 11:10

0 Answers0