Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Updater / Module.php
index 0a244b46bc15ab4fa8ccb2ce608ba10e9cd96413..4829c5380754e4082001742fe4d903fa7b3581cc 100644 (file)
@@ -49,8 +49,9 @@ class Module extends Updater implements UpdaterInterface {
   public function isInstalled() {
     // Check if the module exists in the file system, regardless of whether it
     // is enabled or not.
-    $modules = \Drupal::state()->get('system.module.files', []);
-    return isset($modules[$this->name]);
+    /** @var \Drupal\Core\Extension\ExtensionList $module_extension_list */
+    $module_extension_list = \Drupal::service('extension.list.module');
+    return $module_extension_list->exists($this->name);
   }
 
   /**
@@ -104,7 +105,7 @@ class Module extends Updater implements UpdaterInterface {
    * {@inheritdoc}
    */
   public function postInstallTasks() {
-    // Since this is being called outsite of the primary front controller,
+    // Since this is being called outside of the primary front controller,
     // the base_url needs to be set explicitly to ensure that links are
     // relative to the site root.
     // @todo Simplify with https://www.drupal.org/node/2548095