You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When refactoring the FormElementManager class in #75 and removing support for service-manager v2 the V3Polyfill and FormElementManagerTrait were copied together to a "real" FormElementManager class.
But it seems that the previous method \Laminas\Form\FormElementManager\FormElementManagerTrait::get wasn't copied.
The main purpose of that method was calling \Laminas\Form\FormElementManager::setInvokableClass() for invokable Forms to override the default InovkableFactory with \Laminas\Form\ElementFactory.
Previous behavior
Invokable Forms (and probably all other Elements and Fieldsets) were created with the \Laminas\Form\ElementFactory.
Current behavior
Invokable Forms with options are instantiated incorrectly, because \Laminas\ServiceManager\Factory\InvokableFactory instantiates the object differently.
How to reproduce
Fetch a Form with options from the FormElementManager
Previously, when no custom factory was registered, FormElementManagerTrait::get called FormElementManager::setInvokableClass to use ElementFactory, which creates the object with return new $requestedName($name, $options);. Now, this is missing, causing InvokableFactory to instantiate the class with new $requestedName($options), using the options array as form name.
The default constructor for Fieldset which Form extends from, is public function __construct($name = null, $options = []).
The options array is used as form name and later on, when rendering the form, the escaper view helper throws up when trying to escape the name atrribute of the form opening tag because it's an array and not a string.
The text was updated successfully, but these errors were encountered:
BC Break Report
Summary
When refactoring the
FormElementManager
class in #75 and removing support for service-manager v2 the V3Polyfill andFormElementManagerTrait
were copied together to a "real" FormElementManager class.But it seems that the previous method
\Laminas\Form\FormElementManager\FormElementManagerTrait::get
wasn't copied.The main purpose of that method was calling
\Laminas\Form\FormElementManager::setInvokableClass()
for invokable Forms to override the default InovkableFactory with\Laminas\Form\ElementFactory
.Previous behavior
Invokable Forms (and probably all other Elements and Fieldsets) were created with the
\Laminas\Form\ElementFactory
.Current behavior
Invokable Forms with options are instantiated incorrectly, because
\Laminas\ServiceManager\Factory\InvokableFactory
instantiates the object differently.How to reproduce
Fetch a Form with options from the FormElementManager
Previously, when no custom factory was registered,
FormElementManagerTrait::get
calledFormElementManager::setInvokableClass
to useElementFactory
, which creates the object withreturn new $requestedName($name, $options);
. Now, this is missing, causingInvokableFactory
to instantiate the class withnew $requestedName($options)
, using the options array as form name.The default constructor for
Fieldset
whichForm
extends from, ispublic function __construct($name = null, $options = [])
.The options array is used as form name and later on, when rendering the form, the escaper view helper throws up when trying to escape the
name
atrribute of the form opening tag because it's an array and not a string.The text was updated successfully, but these errors were encountered: