This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
Declaring a Collection with array notation: target element doesn't get it's dependencies #58
Comments
I have the same issue with zend-form 2.8.0, zend-servicemanager 2.7.5 and zend-mvc 2.7.7 |
First off, I'm having trouble replicating this for a few reasons:
I'll work on #64, as it appears to provide enough information for me to be able to reproduce the problem. If you can come up with the minimum code required to reproduce your issue, preferably without requiring the DoctrineModule, please create a gist with it or submit a pull request containing a unit test for it. |
Actually, I think I know what the issue is. Prior to 2.7, the default initializers ( |
weierophinney
added a commit
to weierophinney/zend-form
that referenced
this issue
Apr 28, 2016
Per zendframework#58 and zendframework#64, 2.7.0 introduced a regression due to the fact that the default initializers, `injectFactory()` and `callElementInit()`, were registered *prior* to delegating to the parent constructor instead of *afterwards*. This led to problems when the order of initializers was important (e.g., if an initializer was practicing setter injection, and the injected instance was expected when `init()` was called by `callElementInit()`). This patch provides a test that asserts the expected behavior, and updates the `FormElementManager` constructor to properly inject the initializers after calling the parent constructor.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I get this error with a form that has a Collection-element targeting a Fieldset:
Here is Form example:
And the Fieldset:
I have
ObjectManagerAwareInitializer
that passesObjectManager
to any class that implementsObjectManagerAwareInterface
. It looks like Fieldset doesn't get it's dependencies at a proper time (when init() is called).But it works if I get Fieldset manually (almost) like this:
It wasn't an issue in ZF 2.4. (Right now I'm at 2.5.1)
The text was updated successfully, but these errors were encountered: