diff --git a/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php index b4707c3..90e367e 100644 --- a/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php +++ b/core/modules/system/lib/Drupal/system/Controller/SystemInfoController.php @@ -11,6 +11,7 @@ use Drupal\Core\Extension\ModuleHandler; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Response; +use Drupal\Core\Database\Connection; /** * Returns responses for System Info routes. @@ -25,11 +26,19 @@ class SystemInfoController implements ControllerInterface { protected $moduleHandler; /** + * The database connection object for this controller. + * + * @var \Drupal\Core\Database\Connection + */ + protected $database; + + /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( - $container->get('module_handler') + $container->get('module_handler'), + $container->get('database') ); } @@ -37,10 +46,13 @@ public static function create(ContainerInterface $container) { * Constructs a SystemInfoController object. * * @param \Drupal\Core\Extension\ModuleHandler $module_handler - * Module Handler service. + * Module handler service. + * @param \Drupal\Core\Database\Connection $database + * Database connection. */ - public function __construct(ModuleHandler $module_handler) { + public function __construct(ModuleHandler $module_handler, Connection $database) { $this->moduleHandler = $module_handler; + $this->database = $database; } /** @@ -73,7 +85,7 @@ public function status($check = FALSE) { } // MySQL import might have set the uid of the anonymous user to autoincrement // value. Let's try fixing it. See http://drupal.org/node/204411 - db_update('users') + $this->database->update('users') ->expression('uid', 'uid - uid') ->condition('name', '') ->condition('pass', '')