-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
I don't know if this can be considered a bug, a feature request or neither of the two, but let me explain the problem first: I'm using the ResourceBundle
with Symfony 2.8. From that version of Symfony, how a form is declared (and istantiated) was changed. Instead of using an alias name for each form type, the FCQN of the type class is used (#15079). If a FCQN is used as the form type in the resource config, the default ResourceFormFactory
tries to instantiate the form type by doing a simple new $className()
, and then pass the instance to the underlying form factory. This causes two problems: the first is a deprecation message triggered by the createNamedBuilder
method that doesn't accept anymore an instance of the form type, and the second is that not using an alias there is no way to have a form that takes arguments in the constructor (e.g. injected services). My suggestion is to remove the check for the FCQN in the Sylius form factory, and always let the underyling Symfony form factory to instantiate the form by using the specified type, whatsever it is.