Closed (fixed)
Project:
Dependency Injection (Deprecated)
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jun 2013 at 11:24 UTC
Updated:
26 Aug 2013 at 07:55 UTC
When using this component standalone and dumping the container, the aliases are not set to the default value of $this->aliases = array(). If now calling $container->has() it is checked if $this->alias has a key: array_key_exists($id, $this->aliases). array_key_exists needs an array as second parameter what won't be set if no aliases are set during the container build process. So instead of returning an empty string, returning the initialization value helps to avoid this error.
A PR has been created on github for the component, but if you don't want to use the newest version or wait until it comes out, you can add the patch provided.
| Comment | File | Size | Author |
|---|---|---|---|
| inject_dumper_dumps_correct_constructor_with_initialized_aliases.patch | 895 bytes | mikelohmann |
Comments
Comment #1
mikelohmann commentedComment #2
sylvain lecoy commentedOk mikelohmann,
For the sake of tracability, can you provide the link of the PR ?
I let you informed within the week.
Thanks
Comment #3
sylvain lecoy commentedI could not apply your patch but I pushed this in dev: http://drupalcode.org/project/dependencyinjection.git/commit/6d0cb08.
Can you confirm this work ?
Comment #4
sylvain lecoy commentedI guess this is now fixed.