commit d79f3424bf191630fc69cbf5bb8fa72d8ab1deac
Author: Erik Stielstra <info@erikstielstra.nl>
Date:   Sat Jan 11 17:49:20 2014 +0100

    #34

diff --git a/core/includes/mail.inc b/core/includes/mail.inc
index 61dfb7e..7b08ad3 100644
--- a/core/includes/mail.inc
+++ b/core/includes/mail.inc
@@ -151,8 +151,9 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $reply =
   $message['headers'] = $headers;
 
   // Build the e-mail (get subject and body, allow additional headers) by
-  // invoking hook_mail() on this module. We cannot use module_invoke() as
-  // we need to have $message by reference in hook_mail().
+  // invoking hook_mail() on this module. We cannot use
+  // moduleHandler()->invoke() as we need to have $message by reference in
+  // hook_mail().
   if (function_exists($function = $module . '_mail')) {
     $function($key, $message, $params);
   }
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 3fb7584..c30cf3f 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -100,7 +100,7 @@ public function form(array $form, array &$form_state) {
       '#default_value' => $node->getChangedTime(),
     );
 
-    $language_configuration = module_invoke('language', 'get_default_configuration', 'node', $node->getType());
+    $language_configuration = \Drupal::moduleHandler()->invoke('language', 'get_default_configuration', 'node', $node->getType());
     $form['langcode'] = array(
       '#title' => t('Language'),
       '#type' => 'language_select',
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
index 0d184b6..a24252c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
@@ -117,13 +117,14 @@ function testModuleImplements() {
   }
 
   /**
-   * Test that module_invoke() can load a hook defined in hook_hook_info().
+   * Test that moduleHandler()->invoke() can load a hook defined in
+   * hook_hook_info().
    */
   function testModuleInvoke() {
     \Drupal::moduleHandler()->install(array('module_test'), FALSE);
     $this->resetAll();
     $this->drupalGet('module-test/hook-dynamic-loading-invoke');
-    $this->assertText('success!', 'module_invoke() dynamically loads a hook defined in hook_hook_info().');
+    $this->assertText('success!', 'moduleHandler()->invoke() dynamically loads a hook defined in hook_hook_info().');
   }
 
   /**
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php b/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
index 2251a6e..ab02cde 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
@@ -67,7 +67,7 @@ public function buildOptionsForm(&$form, &$form_state) {
 
     // Get list of permissions
     foreach (\Drupal::moduleHandler()->getImplementations('permission') as $module) {
-      $permissions = module_invoke($module, 'permission');
+      $permissions = \Drupal::moduleHandler()->invoke($module, 'permission');
       foreach ($permissions as $name => $perm) {
         $perms[$module_info[$module]['name']][$name] = strip_tags($perm['title']);
       }
