Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserControllerFactory over-eager loading of all forms from factories #643

Open
nclundsten opened this issue Jun 30, 2016 · 2 comments
Open

Comments

@nclundsten
Copy link

nclundsten commented Jun 30, 2016

https://github.com/ZF-Commons/ZfcUser/blob/1.4.3/src/ZfcUser/Factory/Controller/UserControllerFactory.php

seems really un-necessary to create+inject a change password form, register form, etc when someone is just logging in, same goes for other controller actions

@nclundsten nclundsten changed the title eager loading of all forms from factories into controller when pulled from service manager eager loading all forms from factories into controller when pulled from service manager Jun 30, 2016
@nclundsten nclundsten changed the title eager loading all forms from factories into controller when pulled from service manager UserControllerFactory eager loading all forms from factories Jun 30, 2016
@nclundsten nclundsten changed the title UserControllerFactory eager loading all forms from factories UserControllerFactory over-eager loading of all forms from factories Jun 30, 2016
@nclundsten
Copy link
Author

nclundsten commented Jun 30, 2016

if its determined that the forms should continue to be injected in the controller factory, then we could at least use lazy services -- https://framework.zend.com/manual/2.4/en/modules/zend.service-manager.lazy-services.html

@hurnell
Copy link

hurnell commented Nov 7, 2016

Creating (injecting) the login form in UserControllerFactory causes all flash messages to be lost! This means that when a user changes their password or e-mail address the feedback message will not be displayed.
The UserController::setLoginForm method changes the namespace of the flashMessenger causing all previous messages to be lost.
Remove all the form creation methods and save the overhead of creating forms that will not be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants