laravel-doctrine / extensions

Extensions integration for Doctrine2 and Laravel
http://laraveldoctrine.org/
MIT License
48 stars 24 forks source link

Extension user loading loop #33

Closed qskousen closed 6 years ago

qskousen commented 7 years ago

Using Laravel 5.4. Doctrine is handling the users model.

When certain extensions are enabled (those using ResolveUserDecorator) Doctrine, on loading, will attempt to load the user, due to this part in ResolveUserDecorator.php:70:

if ($this->auth->check()) {
       call_user_func([$this->wrapped, $this->userSetterMethod], $this->auth->user());
}

Since the user is loaded by Doctrine, Laravel will attempt to load Doctrine, which will attempt to load the user... You get the idea.

How can this be worked around to prevent a loop?

patrickbrouwers commented 6 years ago

Closing this as a PR has been submitted to fix it.