Skip to content

[ResourceBundle] ResourceFormFactory is not compatible with Symfony 2.8+ #5590

@ste93cry

Description

@ste93cry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureNew feature proposals.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy