diff --git a/core/includes/entity.api.php b/core/includes/entity.api.php
index 99049f8..6a82958 100644
--- a/core/includes/entity.api.php
+++ b/core/includes/entity.api.php
@@ -452,7 +452,7 @@ function hook_entity_display_alter(\Drupal\entity\Plugin\Core\Entity\EntityDispl
 }
 
 /**
- * Act on an entity object about to be shown on an entity form.
+ * Acts on an entity object about to be shown on an entity form.
  *
  * This can be typically used to pre-fill entity values or change the form state
  * before the entity form is built. It is invoked just once when first building
@@ -466,7 +466,7 @@ function hook_entity_display_alter(\Drupal\entity\Plugin\Core\Entity\EntityDispl
  * @see \Drupal\Core\Entity\EntityFormController::prepareEntity()
  */
 function hook_entity_prepare_form(\Drupal\Core\Entity\EntityInterface $entity, array &$form_state) {
-  if ($form_state['controller']->getOperation() == 'default') {
+  if ($form_state['controller']->getOperation() == 'edit') {
     $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 db02a8d..dc9466e 100644
--- a/core/lib/Drupal/Core/Entity/EntityFormController.php
+++ b/core/lib/Drupal/Core/Entity/EntityFormController.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Entity;
 
 use Drupal\entity\EntityFormDisplayInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Language\Language;
 
 /**
@@ -26,6 +27,13 @@ class EntityFormController implements EntityFormControllerInterface {
   protected $operation;
 
   /**
+   * The module handler service.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
    * The entity being used by this form.
    *
    * @var \Drupal\Core\Entity\EntityInterface
@@ -35,11 +43,20 @@ class EntityFormController implements EntityFormControllerInterface {
   /**
    * Constructs an EntityFormController object.
    *
-   * @param string|null $operation
-   *   (optional) The name of the current operation, defaults to NULL.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
+   */
+  public function __construct(ModuleHandlerInterface $module_handler) {
+    $this->moduleHandler = $module_handler;
+  }
+
+  /**
+   * {@inheritdoc}
    */
-  public function __construct($operation = NULL) {
-    $this->setOperation($operation);
+  public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
+    return new static(
+      $container->get('module_handler')
+    );
   }
 
   /**
@@ -450,18 +467,17 @@ public function setEntity(EntityInterface $entity) {
   /**
    * Prepares the entity object before the form is built first.
    *
-   * This can be used to fill in a default values. It then invokes
-   * hook_entity_prepare_form() and hook_ENTITY_TYPE_prepare_form() on all
-   * modules.
+   * This can be used to fill in default values or alter the form state. It then
+   * invokes hook_entity_prepare_form() and hook_ENTITY_TYPE_prepare_form() on
+   * all modules.
    *
    * @param array $form_state
    *   An associative array containing the current state of the form.
    */
   protected function prepareEntity(array &$form_state) {
-    $handler = \Drupal::moduleHandler();
     $args = array($this->entity, &$form_state);
-    $handler->invokeAll('entity_prepare_form', $args);
-    $handler->invokeAll($this->entity->entityType() . '_prepare_form', $args);
+    $this->moduleHandler->invokeAll('entity_prepare_form', $args);
+    $this->moduleHandler->invokeAll($this->entity->entityType() . '_prepare_form', $args);
   }
 
   /**
diff --git a/core/modules/action/lib/Drupal/action/ActionAddFormController.php b/core/modules/action/lib/Drupal/action/ActionAddFormController.php
index 85db8fe..56d7bbf 100644
--- a/core/modules/action/lib/Drupal/action/ActionAddFormController.php
+++ b/core/modules/action/lib/Drupal/action/ActionAddFormController.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Action\ActionManager;
 use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityStorageControllerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -28,13 +29,15 @@ class ActionAddFormController extends ActionFormControllerBase implements Entity
   /**
    * Constructs a new ActionAddFormController.
    *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller
    *   The action storage controller.
    * @param \Drupal\Core\Action\ActionManager $action_manager
    *   The action plugin manager.
    */
-  public function __construct(EntityStorageControllerInterface $storage_controller, ActionManager $action_manager) {
-    parent::__construct($storage_controller);
+  public function __construct(ModuleHandlerInterface $module_handler, EntityStorageControllerInterface $storage_controller, ActionManager $action_manager) {
+    parent::__construct($module_handler, $storage_controller);
 
     $this->actionManager = $action_manager;
   }
@@ -44,6 +47,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
+      $container->get('module_handler'),
       $container->get('plugin.manager.entity')->getStorageController($entity_type),
       $container->get('plugin.manager.action')
     );
diff --git a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php
index c5d58e6..d1a916d 100644
--- a/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php
+++ b/core/modules/action/lib/Drupal/action/ActionFormControllerBase.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityFormController;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Action\ConfigurableActionInterface;
 use Drupal\Core\Entity\EntityStorageControllerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -35,11 +36,13 @@
   /**
    * Constructs a new action form.
    *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller
    *   The action storage controller.
    */
-  public function __construct(EntityStorageControllerInterface $storage_controller) {
-    parent::__construct();
+  public function __construct(ModuleHandlerInterface $module_handler, EntityStorageControllerInterface $storage_controller) {
+    parent::__construct($module_handler);
 
     $this->storageController = $storage_controller;
   }
@@ -49,6 +52,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
+      $container->get('module_handler'),
       $container->get('plugin.manager.entity')->getStorageController($entity_type)
     );
   }
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php
index 9db5b1d..7e595d2 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Form/CustomBlockTypeDeleteForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\Query\QueryFactory;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -28,10 +29,13 @@ class CustomBlockTypeDeleteForm extends EntityConfirmFormBase implements EntityC
   /**
    * Constructs a query factory object.
    *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
    *   The entity query object.
    */
-  public function __construct(QueryFactory $query_factory) {
+  public function __construct(ModuleHandlerInterface $module_handler, QueryFactory $query_factory) {
+    parent::__construct($module_handler);
     $this->queryFactory = $query_factory;
   }
 
@@ -40,6 +44,7 @@ public function __construct(QueryFactory $query_factory) {
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
+      $container->get('module_handler'),
       $container->get('entity.query')
     );
   }
diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php
index 481cf7c..a3ffe5d 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldDeleteForm.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityManager;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -27,10 +28,13 @@ class FieldDeleteForm extends EntityConfirmFormBase implements EntityControllerI
   /**
    * Constructs a new FieldDeleteForm object.
    *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\Core\Entity\EntityManager $entity_manager
    *   The entity manager.
    */
-  public function __construct(EntityManager $entity_manager) {
+  public function __construct(ModuleHandlerInterface $module_handler, EntityManager $entity_manager) {
+    parent::__construct($module_handler);
     $this->entityManager = $entity_manager;
   }
 
@@ -39,6 +43,7 @@ public function __construct(EntityManager $entity_manager) {
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
+      $container->get('module_handler'),
       $container->get('plugin.manager.entity')
     );
   }
diff --git a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php
index 60129fa..f605d0a 100644
--- a/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php
+++ b/core/modules/menu/lib/Drupal/menu/Form/MenuDeleteForm.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Entity\EntityConfirmFormBase;
 use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityStorageControllerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -35,12 +36,15 @@ class MenuDeleteForm extends EntityConfirmFormBase implements EntityControllerIn
   /**
    * Constructs a new MenuDeleteForm.
    *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\Core\Entity\EntityStorageControllerInterface $storage_controller
    *   The menu link storage controller.
    * @param \Drupal\Core\Database\Connection $connection
    *   The database connection.
    */
-  public function __construct(EntityStorageControllerInterface $storage_controller, Connection $connection) {
+  public function __construct(ModuleHandlerInterface $module_handler, EntityStorageControllerInterface $storage_controller, Connection $connection) {
+    parent::__construct($module_handler);
     $this->storageController = $storage_controller;
     $this->connection = $connection;
   }
@@ -50,6 +54,7 @@ public function __construct(EntityStorageControllerInterface $storage_controller
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
+      $container->get('module_handler'),
       $container->get('plugin.manager.entity')->getStorageController('menu_link'),
       $container->get('database')
     );
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 fa0d4c5..e6e0f0d 100644
--- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php
+++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkFormController.php
@@ -52,17 +52,16 @@ class MenuLinkFormController extends EntityFormController implements EntityContr
   /**
    * Constructs a new MenuLinkFormController object.
    *
-   * @param string $operation
-   *   The name of the current operation.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\Core\Path\AliasManagerInterface $path_alias_manager
    *   The path alias manager.
    */
-  public function __construct($operation, MenuLinkStorageControllerInterface $menu_link_storage_controller, AliasManagerInterface $path_alias_manager, UrlGenerator $url_generator, ModuleHandlerInterface $module_handler) {
-    parent::__construct($operation);
+  public function __construct(ModuleHandlerInterface $module_handler, MenuLinkStorageControllerInterface $menu_link_storage_controller, AliasManagerInterface $path_alias_manager, UrlGenerator $url_generator) {
+    parent::__construct($module_handler);
     $this->menuLinkStorageController = $menu_link_storage_controller;
     $this->pathAliasManager = $path_alias_manager;
     $this->urlGenerator = $url_generator;
-    $this->moduleHandler = $module_handler;
   }
 
   /**
@@ -70,11 +69,10 @@ public function __construct($operation, MenuLinkStorageControllerInterface $menu
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) {
     return new static(
-      $operation,
+      $container->get('module_handler'),
       $container->get('plugin.manager.entity')->getStorageController('menu_link'),
       $container->get('path.alias_manager.cached'),
-      $container->get('url_generator'),
-      $container->get('module_handler')
+      $container->get('url_generator')
     );
   }
 
diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutDeleteForm.php b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutDeleteForm.php
index 296ae9b..d09a61f 100644
--- a/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutDeleteForm.php
+++ b/core/modules/shortcut/lib/Drupal/shortcut/Form/ShortcutDeleteForm.php
@@ -12,7 +12,7 @@
 use Drupal\shortcut\ShortcutStorageControllerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Database\Connection;
-use Drupal\Core\Extension\ModuleHandlerInterface;
+
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -28,13 +28,6 @@ class ShortcutDeleteForm extends EntityConfirmFormBase implements EntityControll
   protected $database;
 
   /**
-   * The module handler service.
-   *
-   * @var \Drupal\Core\Extension\ModuleHandlerInterface
-   */
-  protected $moduleHandler;
-
-  /**
    * The shortcut storage controller.
    *
    * @var \Drupal\shortcut\ShortcutStorageControllerInterface
@@ -44,9 +37,9 @@ class ShortcutDeleteForm extends EntityConfirmFormBase implements EntityControll
   /**
    * Constructs a ShortcutDeleteForm object.
    */
-  public function __construct(Connection $database, ModuleHandlerInterface $module_handler, ShortcutStorageControllerInterface $storage_controller) {
+  public function __construct(ModuleHandlerInterface $module_handler, Connection $database, ShortcutStorageControllerInterface $storage_controller) {
+    parent::__construct($module_handler);
     $this->database = $database;
-    $this->moduleHandler = $module_handler;
     $this->storageController = $storage_controller;
   }
 
@@ -55,8 +48,8 @@ public function __construct(Connection $database, ModuleHandlerInterface $module
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
-      $container->get('database'),
       $container->get('module_handler'),
+      $container->get('database'),
       $container->get('plugin.manager.entity')->getStorageController('shortcut')
     );
   }
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
index 638144e..97b9b88 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_ui;
 
 use Drupal\Core\Entity\EntityControllerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\views\Plugin\views\wizard\WizardPluginBase;
 use Drupal\views\Plugin\views\wizard\WizardException;
 use Drupal\views\Plugin\ViewsPluginManager;
@@ -28,13 +29,13 @@ class ViewAddFormController extends ViewFormControllerBase implements EntityCont
   /**
    * Constructs a new ViewEditFormController object.
    *
-   * @param string $operation
-   *   The name of the current operation.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\views\Plugin\ViewsPluginManager $wizard_manager
    *   The wizard plugin manager.
    */
-  public function __construct($operation, ViewsPluginManager $wizard_manager) {
-    parent::__construct($operation);
+  public function __construct(ModuleHandlerInterface $module_handler, ViewsPluginManager $wizard_manager) {
+    parent::__construct($module_handler);
 
     $this->wizardManager = $wizard_manager;
   }
@@ -42,9 +43,9 @@ public function __construct($operation, ViewsPluginManager $wizard_manager) {
   /**
    * {@inheritdoc}
    */
-  public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) {
+  public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) {
     return new static(
-      $operation,
+      $container->get('module_handler'),
       $container->get('plugin.manager.views.wizard')
     );
   }
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
index 1f3869c..e3fa4c6 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Ajax\AjaxResponse;
 use Drupal\Core\Ajax\HtmlCommand;
 use Drupal\Core\Ajax\ReplaceCommand;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\views\ViewExecutable;
 use Drupal\Core\Entity\EntityControllerInterface;
@@ -39,15 +40,15 @@ class ViewEditFormController extends ViewFormControllerBase implements EntityCon
   /**
    * Constructs a new ViewEditFormController object.
    *
-   * @param string $operation
-   *   The name of the current operation.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\user\TempStoreFactory $temp_store_factory
    *   The factory for the temp store object.
    * @param \Symfony\Component\HttpFoundation\Request $request
    *   The request object.
    */
-  public function __construct($operation, TempStoreFactory $temp_store_factory, Request $request) {
-    parent::__construct($operation);
+  public function __construct(ModuleHandlerInterface $module_handler, TempStoreFactory $temp_store_factory, Request $request) {
+    parent::__construct($module_handler);
 
     $this->tempStore = $temp_store_factory->get('views');
     $this->request = $request;
@@ -58,7 +59,7 @@ public function __construct($operation, TempStoreFactory $temp_store_factory, Re
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) {
     return new static(
-      $operation,
+      $container->get('module_handler'),
       $container->get('user.tempstore'),
       $container->get('request')
     );
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
index 4075c24..87a760a 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
@@ -66,7 +66,7 @@ protected function prepareEntity(array &$form_state) {
     elseif ($this->displayID) {
       throw new NotFoundHttpException();
     }
-    // Invoke prepare hooks.
+
     parent::prepareEntity($form_state);
   }
 
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php
index b0efc08..d47d869 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/ViewPreviewFormController.php
@@ -8,6 +8,7 @@
 namespace Drupal\views_ui;
 
 use Drupal\Core\Entity\EntityControllerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\user\TempStoreFactory;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -26,13 +27,13 @@ class ViewPreviewFormController extends ViewFormControllerBase implements Entity
   /**
    * Constructs a new ViewPreviewFormController object.
    *
-   * @param string $operation
-   *   The name of the current operation.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface
+   *   The module handler service.
    * @param \Drupal\user\TempStoreFactory $temp_store_factory
    *   The factory for the temp store object.
    */
-  public function __construct($operation, TempStoreFactory $temp_store_factory) {
-    parent::__construct($operation);
+  public function __construct(ModuleHandlerInterface $module_handler, TempStoreFactory $temp_store_factory) {
+    parent::__construct($module_handler);
 
     $this->tempStore = $temp_store_factory->get('views');
   }
@@ -42,7 +43,7 @@ public function __construct($operation, TempStoreFactory $temp_store_factory) {
    */
   public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info, $operation = NULL) {
     return new static(
-      $operation,
+      $container->get('module_handler'),
       $container->get('user.tempstore')
     );
   }
