This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
Comprehensive fix for BC breaks introduced since 2.7.1 #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch:
Essentially, two principal issues were identified:
ElementFactory
to ensure they are instantiated correctly. Unfortunately, due to the fact that the "auto add invokables" flag is enabled, and that users can callsetInvokableClass()
or defineinvokables
configuration, any such mappings were leading to the classes getting the base zend-servicemanager behavior instead. This patch solves that by creating polyfill solutions for zend-servicemanager v2 and v3 releases, and overriding thesetInvokableClass()
implementations under each to ensure they map invokables to the specialized factory and set any needed aliases. (These polyfills also ensure that the version-specific instantiation rules are present.)Zend\Form\Factory
when using collections, which fetch their target "element" when it's set via options. The break was due to a change inZend\Form\Factory::create()
, which was passing discovered options toFormElementManager::get()
. This led to an order-of-operations issue, as the options were then processed during instantiation, when previously they were processed afterwards, ensuring all setter injections were already complete. The erroneous code was removed.