diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php
index 6a82958..8520d24 100644
--- a/core/includes/entity.api.php
+++ b/core/includes/entity.api.php
@@ -458,15 +458,16 @@ function hook_entity_display_alter(\Drupal\entity\Plugin\Core\Entity\EntityDispl
  * before the entity form is built. It is invoked just once when first building
  * the entity form. Rebuilds will not trigger a new invocation.
  *
- * @param \Drupal\Core\Entity\EntityInterface $entity
- *   The entity that is about to be shown on the add/edit form.
+ * @param \Drupal\Core\Entity\EntityFormControllerInterface $controller
+ *   The form controller responsible handling the form.
  * @param array $form_state
  *   An associative array containing the current state of the form.
  *
  * @see \Drupal\Core\Entity\EntityFormController::prepareEntity()
  */
-function hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, array &$form_state) {
-  if ($form_state['controller']->getOperation() == 'edit') {
+function hook_entity_prepare_form(\Drupal\Core\Entity\EntityFormControllerInterface $controller, array &$form_state) {
+  if ($controller->getOperation() == 'edit') {
+    $entity = $controller->getEntity();
     $entity->label->value = 'Altered label';
     $form_state['mymodule']['label_altered'] = TRUE;
   }
diff --git a/core/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php
index bfbcf3c..7c5bbc1 100644
--- a/core/lib/Drupal/Core/Entity/EntityFormController.php
+++ b/core/lib/Drupal/Core/Entity/EntityFormController.php
@@ -10,6 +10,7 @@
 use Drupal\entity\EntityFormDisplayInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\Language;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Base class for entity form controllers.
diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php
index c6561b6..648ec98 100644
--- a/core/lib/Drupal/Core/Entity/EntityManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityManager.php
@@ -227,11 +227,11 @@ public function getFormController($entity_type, $operation) {
       $class = $this->getControllerClass($entity_type, 'form', $operation);
       if (in_array('Drupal\Core\Entity\EntityControllerInterface', class_implements($class))) {
         $this->controllers['form'][$operation][$entity_type] = $class::createInstance($this->container, $entity_type, $this->getDefinition($entity_type));
-        $this->controllers['form'][$operation][$entity_type]->setOperation($operation);
       }
       else {
-        $this->controllers['form'][$operation][$entity_type] = new $class($operation);
+        $this->controllers['form'][$operation][$entity_type] = new $class($this->container->get('module_handler'));
       }
+      $this->controllers['form'][$operation][$entity_type]->setOperation($operation);
     }
     return $this->controllers['form'][$operation][$entity_type];
   }
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index bf8ecdd..ed1b7ab 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityFormControllerInterface;
 use Drupal\Core\Language\Language;
 use Drupal\entity\Plugin\Core\Entity\EntityDisplay;
 use Drupal\Core\Template\Attribute;
@@ -876,7 +877,8 @@ function book_node_predelete(EntityInterface $node) {
 /**
  * Implements hook_node_prepare_form().
  */
-function book_node_prepare_form(EntityInterface $node, array &$form_state) {
+function book_node_prepare_form(EntityFormControllerInterface $controller, array &$form_state) {
+  $node = $this->getEntity();
   // Prepare defaults for the add/edit form.
   if (empty($node->book) && (user_access('add content to books') || user_access('administer book outlines'))) {
     $node->book = array();
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 0925a5e..d96ac09 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -12,6 +12,7 @@
 use Drupal\entity\Plugin\Core\Entity\EntityDisplay;
 use Drupal\file\Plugin\Core\Entity\File;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityFormControllerInterface;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 use Symfony\Component\HttpKernel\HttpKernelInterface;
@@ -1179,7 +1180,8 @@ function comment_node_load($nodes, $types) {
 /**
  * Implements hook_node_prepare_form().
  */
-function comment_node_prepare_form(EntityInterface $node, array &$form_state) {
+function comment_node_prepare_form(EntityFormControllerInterface $controller, array &$form_state) {
+  $node = $controller->getEntity();
   if (!isset($node->comment)) {
     $node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN);
   }
diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module
index 04746f3..5bb4f7e 100644
--- a/core/modules/datetime/datetime.module
+++ b/core/modules/datetime/datetime.module
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\Entity\EntityFormControllerInterface;
 use Drupal\Core\Template\Attribute;
 use Drupal\datetime\DateHelper;
 use Drupal\node\NodeInterface;
@@ -1149,7 +1150,8 @@ function datetime_form_node_form_alter(&$form, &$form_state, $form_id) {
 /**
  * Implements hook_node_prepare_form().
  */
-function datetime_node_prepare_form(NodeInterface $node, array &$form_state) {
+function datetime_node_prepare_form(EntityFormControllerInterface $controller, array &$form_state) {
+  $node = $controller->getEntity();
   // Prepare the 'Authored on' date to use datetime.
   $node->date = new DrupalDateTime($node->created);
 }
diff --git a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php
index f9d4965..98495d5 100644
--- a/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php
+++ b/core/modules/filter/lib/Drupal/filter/FilterFormatFormControllerBase.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityFormController;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -35,12 +36,15 @@
   /**
    * Constructs a new FilterFormatFormControllerBase.
    *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\Core\Config\ConfigFactory $config_factory
    *   The config factory.
    * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
    *   The entity query factory.
    */
-  public function __construct(ConfigFactory $config_factory, QueryFactory $query_factory) {
+  public function __construct(ModuleHandlerInterface $module_handler, ConfigFactory $config_factory, QueryFactory $query_factory) {
+    parent::__construct($module_handler);
     $this->configFactory = $config_factory;
     $this->queryFactory = $query_factory;
   }
@@ -50,6 +54,7 @@ public function __construct(ConfigFactory $config_factory, QueryFactory $query_f
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
+      $container->get('module_handler'),
       $container->get('config.factory'),
       $container->get('entity.query')
     );
diff --git a/core/modules/menu/lib/Drupal/menu/MenuFormController.php b/core/modules/menu/lib/Drupal/menu/MenuFormController.php
index 62a92ff..a709d2e 100644
--- a/core/modules/menu/lib/Drupal/menu/MenuFormController.php
+++ b/core/modules/menu/lib/Drupal/menu/MenuFormController.php
@@ -9,7 +9,6 @@
 
 use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityFormController;
-use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\Language;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -19,37 +18,6 @@
 class MenuFormController extends EntityFormController implements EntityControllerInterface {
 
   /**
-   * The module handler to invoke hooks on.
-   *
-   * @var \Drupal\Core\Extension\ModuleHandlerInterface
-   */
-  protected $moduleHandler;
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) {
-    return new static(
-      $operation,
-      $container->get('module_handler')
-    );
-  }
-
-  /**
-   * Constructs a new EntityListController object.
-   *
-   * @param string $operation
-   *   The name of the current operation.
-   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
-   *   The module handler to invoke hooks on.
-   */
-  public function __construct($operation, ModuleHandlerInterface $module_handler) {
-    parent::__construct($operation);
-
-    $this->moduleHandler = $module_handler;
-  }
-
-  /**
    * Overrides Drupal\Core\Entity\EntityFormController::form().
    */
   public function form(array $form, array &$form_state) {
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index afed76d..eb7561b 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -12,6 +12,7 @@
  */
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityFormControllerInterface;
 use Drupal\block\BlockPluginInterface;
 use Drupal\system\Plugin\Core\Entity\Menu;
 use Symfony\Component\HttpFoundation\JsonResponse;
@@ -491,7 +492,8 @@ function menu_node_predelete(EntityInterface $node) {
 /**
  * Implements hook_node_prepare_form().
  */
-function menu_node_prepare_form(EntityInterface $node, array &$form_state) {
+function menu_node_prepare_form(EntityFormControllerInterface $controller, array &$form_state) {
+  $node = $this->getEntity();
   if (empty($node->menu)) {
     // Prepare the node for the edit form so that $node->menu always exists.
     $menu_name = strtok(variable_get('menu_parent_' . $node->type, 'main:0'), ':');
diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php
index e6e0f0d..6064108 100644
--- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php
+++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php
@@ -43,13 +43,6 @@ class MenuLinkFormController extends EntityFormController implements EntityContr
   protected $urlGenerator;
 
   /**
-   * The module handler
-   *
-   * @var \Drupal\Core\Extension\ModuleHandlerInterface
-   */
-  protected $moduleHandler;
-
-  /**
    * Constructs a new MenuLinkFormController object.
    *
    * @param \Drupal\Core\Extension\ModuleHandlerInterface
diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php
index cf9d77e..077d4f0 100644
--- a/core/modules/node/node.api.php
+++ b/core/modules/node/node.api.php
@@ -593,6 +593,26 @@ function hook_node_access($node, $op, $account, $langcode) {
   return NODE_ACCESS_IGNORE;
 }
 
+
+/**
+ * Act on a node object about to be shown on the add/edit form.
+ *
+ * This hook is invoked from NodeFormController::prepareEntity().
+ *
+ * @param \Drupal\Core\Entity\EntityFormControllerInterface $controller
+ *   The form controller responsible handling the form.
+ * @param array $form_state
+ *   An associative array containing the current state of the form.
+ *
+ * @ingroup node_api_hooks
+ */
+function hook_node_prepare_form(\Drupal\Core\Entity\EntityFormControllerInterface $controller, array &$form_state) {
+  $node = $controller->getEntity();
+  if (!isset($node->comment)) {
+    $node->comment = variable_get("comment_$node->type", COMMENT_NODE_OPEN);
+  }
+}
+
 /**
  * Act on a node being displayed as a search result.
  *
diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module
index 9302366..1725668 100644
--- a/core/modules/translation/translation.module
+++ b/core/modules/translation/translation.module
@@ -20,6 +20,7 @@
  */
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityFormControllerInterface;
 use Drupal\Core\Language\Language;
 use Drupal\entity\Plugin\Core\Entity\EntityDisplay;
 
@@ -306,7 +307,8 @@ function translation_node_view(EntityInterface $node, EntityDisplay $display, $v
 /**
  * Implements hook_node_prepare_form().
  */
-function translation_node_prepare_form(EntityInterface $node) {
+function translation_node_prepare_form(EntityFormControllerInterface $controller, array &$form_state) {
+  $node = $controller->getEntity();
   $query = Drupal::request()->query;
   $translation = $query->get('translation');
   $target = $query->get('target');
