Closed zluiten closed 7 years ago
Hi @netiul I'm using your PR and got an error when login in:
File:
vendor/zf-commons/zfc-user/src/ZfcUser/Authentication/Adapter/AdapterChain.php:90
Message:
Call to a member function getListeners() on null
By commenting the resetAdapters function content it works. Any idea on what's wrong?
PS: Using along with ZfcUserDoctrineORM.
@phgeek @netiul I found out that AdapterChain class calls getEventManager()
that lazy-loads an EventManager instance if none is registered. This lazy-loaded instance have $sharedEventManager
defaults to null. This is the line in resetAdapters()
that made the error.
$listeners = $this->getEventManager()->getSharedManager()->getListeners(['authenticate'], 'authenticate');
Basically, getSharedManager()
returned null because no $sharedEventManager
was set. And so, the call for getListeners()
trigerred an error. The fix would be to check first if it's null, right?
Also, I noticed that ZfcUserDoctrineORM should also be changed to be compatible with the PR. ZfcUserDoctrineORM/Mapper/User::insert()
and ZfcUserDoctrineORM/Mapper/User::update()
methods must use type hint now.
Other than that, this PR is really cool. 👍
Thank you, your changes have been introduced in 3.x!
Great work Daniel! Thanks a lot for taking on this huge project. Users: We've been waiting a long time for this, let's work to upgrade to 3.0 to work out any bugs quickly. I'm sure I'm not the only one who's still on ZF2, waiting for ZfcUser to upgrade.
642