Problem/Motivation
From entity.api.php:
- defaults: For entity form routes, use _entity_form rather than the generic _controller or _form.
Unfortunately we do not follow this directive and have some places where we define an entity form through a controller, which then retrieves the form through the entity form builder.
Actually we don't need the controller at all, as _entity_form takes care of everything.
This is also a contributed project blocker. autosave_form gets active only on _entity_form routes. This is the case for the entity.node.edit_form
route. However there is the feature request to make autosave_form active also for new entities on the add page. As the node.add route is defined through _controller instead through _entity_form this is not possible.
Proposed resolution
Switch from _controller to _entity_form and deprecate the controller. The change should be completely safe as we don't have any logic inside \Drupal\node\Controller\NodeController::add()
.