diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index d48ae83..37c210f 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -963,7 +963,7 @@ function install_base_system(&$install_state) { // Enable the user module so that sessions can be recorded during the // upcoming bootstrap step. - \Drupal::moduleHandler()->install(array('user'), FALSE); + \Drupal::moduleHandler()->install(array('user')); // Save the list of other modules to install for the upcoming tasks. // State can be set to the database now that system.module is installed. diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index 08a3ec5..0e2180f 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -651,21 +651,18 @@ public function install(array $module_list, $enable_dependencies = TRUE) { return TRUE; } - // Conditionally add the dependencies to the list of modules. - if ($enable_dependencies) { - // Add dependencies to the list. The new modules will be processed as - // the while loop continues. - while (list($module) = each($module_list)) { - foreach (array_keys($module_data[$module]->requires) as $dependency) { - if (!isset($module_data[$dependency])) { - // The dependency does not exist. - return FALSE; - } + // Add dependencies to the list. The new modules will be processed as + // the while loop continues. + while (list($module) = each($module_list)) { + foreach (array_keys($module_data[$module]->requires) as $dependency) { + if (!isset($module_data[$dependency])) { + // The dependency does not exist. + return FALSE; + } - // Skip already installed modules. - if (!isset($module_list[$dependency]) && !isset($installed_modules[$dependency])) { - $module_list[$dependency] = $dependency; - } + // Skip already installed modules. + if (!isset($module_list[$dependency]) && !isset($installed_modules[$dependency])) { + $module_list[$dependency] = $dependency; } } } diff --git a/core/modules/user/lib/Drupal/user/UserStorage.php b/core/modules/user/lib/Drupal/user/UserStorage.php index afd53b3..bad10da 100644 --- a/core/modules/user/lib/Drupal/user/UserStorage.php +++ b/core/modules/user/lib/Drupal/user/UserStorage.php @@ -99,7 +99,9 @@ function mapFromStorageRecords(array $records) { * {@inheritdoc} */ public function save(EntityInterface $entity) { - if (!$entity->id()) { + // The anonymous user account is saved with the fixed user ID of 0. + // Therefore we need to check for NULL explicitly. + if ($entity->id() === NULL) { $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {users}')->fetchField()); $entity->enforceIsNew(); } diff --git a/core/modules/user/user.info.yml b/core/modules/user/user.info.yml index 45a421a..0c7b4cf 100644 --- a/core/modules/user/user.info.yml +++ b/core/modules/user/user.info.yml @@ -6,3 +6,5 @@ version: VERSION core: 8.x required: true configure: user.admin_index +dependencies: + - field diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 1cb3dbd..558cade 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -222,15 +222,17 @@ function user_schema() { function user_install() { $storage = \Drupal::entityManager()->getStorage('user'); // Insert a row for the anonymous user. - $anonymous_user = $storage->create(array('uid' => 0)); - $anonymous_user->save(); + $storage + ->create(array('uid' => 0)) + ->save(); // We need some placeholders here as name and mail are uniques. // This will be changed by the settings form in the installer. - $site_maintenance_user = $storage->create(array( - 'uid' => 1, - 'name' => 'placeholder-for-uid-1', - 'mail' => 'placeholder-for-uid-1', - )); - $site_maintenance_user->save(); + $storage + ->create(array( + 'uid' => 1, + 'name' => 'placeholder-for-uid-1', + 'mail' => 'placeholder-for-uid-1', + )) + ->save(); }