Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #0
Problem/Motivation
EntityFormController has a createInstance() method without implementing EntityControllerInterface.
This has led to extreme confusion, since a entity type subclass of this tries to override createInstance(), and it is never called.
Proposed resolution
Either remove the method, or implement the interface.
Remaining tasks
Pick an approach.
User interface changes
N/A
API changes
Either none, or entity forms subclasses no longer need to explicitly implement EntityControllerInterface for injection.
Related Issues
Comment | File | Size | Author |
---|---|---|---|
entity-form-controller-createInstance-B.patch | 560 bytes | tim.plunkett | |
entity-form-controller-createInstance-A.patch | 671 bytes | tim.plunkett | |
Comments
Comment #1
tim.plunkettThis was introduced by #2025991: Introduce hook_entity_prepare_form() to generalize hook_node_prepare() for absolutely no reason whatsoever :)
We really should have had a setModuleHandler() instead...
Comment #2
tim.plunkettThis is obsolete if we go with the new approach in #2059245-22: Add a FormBase class containing useful methods
Comment #3
XanoThis was apparently fixed somewhere else already.