[BUG]: Forms
requires TagFactory
#15847
Labels
bug
A bug report
discussion
Request for comments and discussion
enhancement
Enhancement to the framework
status: high
High
The new implementation of HTML generators (
TagFactory
) is registered in the DI container using the nametag
. It is required by theForms
component to start rendering components.The constructor of
Form
accepts an entity and user data, stores that information and immediately callsinitialize
(with that data) if present in the child class.Changing the signature of the constructor is going to break backwards compatibility for all applications that are being upgraded to v5. Since forms are a commonly used component, this will require a time consuming refactoring.
All the work that has been done in v4 and v5 was with the aim to no longer rely on a central DI container accessed as a singleton, rather have services injected into components by an new (future) container that will offer automatic injection of services.
However with the above scenario, this will not be feasible at least for
Forms
.Steps to get the best balance for everyone:
Html\Forms
component that will use injected services in the constructor (TagFactory
in particular)Forms
(current) will:TagFactory
is defined (Element)TagFactory
thereDi::getDefault()
to resolve thetag
serviceTagFactory
componentThe above is not the best solution but it will help for this version, so that current applications will not need a huge refactoring effort.
The text was updated successfully, but these errors were encountered: