Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Zend\Form\FormInterface causes Di to attempt to instantiate Interface #3812

Closed
bvoronov opened this issue Feb 18, 2013 · 2 comments
Closed
Milestone

Comments

@bvoronov
Copy link

File: Zend\Di\Di.php:245
Message: Invalid instantiator of type "NULL" for "Zend\Form\FormInterface".
Stack trace:
0 Zend\Di\Di.php(174): Zend\Di\Di->newInstance('Zend\Form\FormI...', Array, true) 1 Zend\Di\Di.php(691): Zend\Di\Di->get('Zend\Form\FormI...', Array) 2 Zend\Di\Di.php(461): Zend\Di\Di->resolveMethodParameters('Application\Form\Test', 'prepareElement', Array, NULL, true) 3 Zend\Di\Di.php(312): Zend\Di\Di->resolveAndCallInjectionMethodForInstance(Object(Application\Form\Test), 'prepareElement', Array, NULL, true, 'Application\Form\Test') 4 Zend\Di\Di.php(256): Zend\Di\Di->handleInjectDependencies(Object(Application\Form\Test), Array, Array, 'Application\Form\Test', NULL, 'Application\Form\Test') 5 Zend\Di\Di.php(174): Zend\Di\Di->newInstance('Application\Form\Test', Array, true) 6 IndexController.php(33): Zend\Di\Di->get('Application\Form\Test')

namespace Application\Form {
    class Test extends \Zend\Form\Form {}
}

Config contains empty 'di' array. ZF 2.1.1

@weierophinney
Copy link
Member

Remove the empty di configuration.

@bvoronov
Copy link
Author

Hi, Matthew.

Blank configuration DI need for automatically initialize Zend\ServiceManager\Di\DiAbstractServiceFactory and registrate it as an abstract factory of the main service manager.
After that, try to get an instance of the form from ServiceManager(or Di) ends with the bug.
Code posted to https://github.com/bvoronov/testapp (exteds from zendframework/ZendSkeletonApplication)

Thanks.

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

No branches or pull requests

2 participants