Problem/Motivation

Setter injection was used for entity handlers, but really should just use constructor injection. Also, per #2337191: Split up EntityManager into many services, EntityManager is being split into many services, and an entity form handler should depend on the specific service.

Proposed resolution

Remove the method from the interface, and the call in \Drupal\Core\Entity\EntityTypeManager::getFormObject()

Remaining tasks

User interface changes

API changes

Data model changes

Comments

tim.plunkett created an issue. See original summary.

dawehner’s picture

+1

catch’s picture

Category: Bug report » Task
catch’s picture

tim.plunkett’s picture

Title: Remove \Drupal\Core\Entity\EntityFormInterface::setEntityManager() » Remove \Drupal\Core\Entity\EntityFormInterface::setEntityTypeManager()
Status: Closed (duplicate) » Active

When we added setEntityTypeManager, we moved the deprecation notice. It's not deprecated (not sure why), but should still be removed.

catch’s picture

Title: Remove \Drupal\Core\Entity\EntityFormInterface::setEntityTypeManager() » Deprecate \Drupal\Core\Entity\EntityFormInterface::setEntityTypeManager()
Version: 9.x-dev » 8.3.x-dev

It needs to be deprecated first then, and it's still used once in core so that also needs to be converted.

Berdir’s picture

Not convinced about this at all. EntityForm needs the entity type manager, for example in \Drupal\Core\Entity\EntityForm::getEntityFromRouteMatch(). So we can't remove it, we could just switch to constructor injection. And that would break every single subclass that injects its own classes.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Berdir’s picture

Status: Active » Closed (won't fix)

Still -1 on that, like I was 2+ years ago :) We also undeprecated (or plan to) EntityHandlerBase with similar arguments. So I'm closing this, if someone disagrees they are free to re-open this issue.