diff --git a/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php b/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php index 38d184e4c05c8c924a050305758e0c0c0d3e3a0a..9f986abbc189a032fa76abd37e44f4a039661cc7 100644 --- a/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php +++ b/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php @@ -49,7 +49,6 @@ function setUp() { // Configure the theme system. $this->installConfig(array('system', 'field')); $this->installSchema('entity_test', 'entity_test'); - $this->installSchema('user', 'users'); // @todo Add helper methods for all of the following. diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php index 80fc18ad7f80db1d46d678169d227b589d1e344c..35af76a8b11bac3a0b4d3b76a4c5b0f0a223761d 100644 --- a/core/modules/user/lib/Drupal/user/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Entity/User.php @@ -266,13 +266,6 @@ public function setEmail($mail) { return $this; } - /** - * {@inheritdoc} - */ - public function getDefaultTheme() { - return $this->get('theme')->value; - } - /** * {@inheritdoc} */ @@ -482,11 +475,6 @@ public static function baseFieldDefinitions($entity_type) { ->setLabel(t('Signature format')) ->setDescription(t('The signature format of this user.')); - $fields['theme'] = FieldDefinition::create('string') - ->setLabel(t('Theme')) - ->setDescription(t('The default theme of this user.')) - ->setPropertyConstraints('value', array('Length' => array('max' => DRUPAL_EXTENSION_NAME_MAX_LENGTH))); - $fields['timezone'] = FieldDefinition::create('string') ->setLabel(t('Timezone')) ->setDescription(t('The timezone of this user.')) diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php index a164da94968ab32d9bec032d8bb1d7fccd56a759..8b6bb8c71767087c60fcadc6a44e845ebb80b173 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php @@ -182,7 +182,6 @@ function testRegistrationDefaultValues() { $new_user = reset($accounts); $this->assertEqual($new_user->getUsername(), $name, 'Username matches.'); $this->assertEqual($new_user->getEmail(), $mail, 'E-mail address matches.'); - $this->assertEqual($new_user->theme->value, '', 'Correct theme field.'); $this->assertEqual($new_user->getSignature(), '', 'Correct signature field.'); $this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20 ), 'Correct creation time.'); $this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.'); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php index 642120f2d78b45b4750023c37800a34b82c08770..cf68623ee77472c6e47190841aef7920c7bb8d31 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php @@ -125,10 +125,6 @@ function testValidation() { $this->assertLengthViolation($user, 'signature', 255); $user->set('signature', NULL); - $user->set('theme', $this->randomString(DRUPAL_EXTENSION_NAME_MAX_LENGTH + 1)); - $this->assertLengthViolation($user, 'theme', DRUPAL_EXTENSION_NAME_MAX_LENGTH); - $user->set('theme', NULL); - $user->set('timezone', $this->randomString(33)); $this->assertLengthViolation($user, 'timezone', 32); $user->set('timezone', NULL); diff --git a/core/modules/user/lib/Drupal/user/Theme/UserNegotiator.php b/core/modules/user/lib/Drupal/user/Theme/UserNegotiator.php deleted file mode 100644 index f601acf6ca1f8edeff19b75d068265c730f80733..0000000000000000000000000000000000000000 --- a/core/modules/user/lib/Drupal/user/Theme/UserNegotiator.php +++ /dev/null @@ -1,68 +0,0 @@ -<?php - -/** - * @file - * Contains \Drupal\user\Theme\UserNegotiator. - */ - -namespace Drupal\user\Theme; - -use Drupal\Core\Entity\EntityManager; -use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Theme\ActiveTheme; -use Drupal\Core\Theme\ThemeNegotiatorInterface; -use Symfony\Component\HttpFoundation\Request; - -/** - * Defines the theme negotiator service for theme configured per user. - */ -class UserNegotiator implements ThemeNegotiatorInterface { - - /** - * The user storage controller. - * - * @var \Drupal\user\UserStorageControllerInterface - */ - protected $userStorageController; - - /** - * The current user. - * - * @var \Drupal\Core\Session\AccountInterface - */ - protected $currentUser; - - /** - * Constructs a UserNegotiator object. - * - * @param \Drupal\Core\Entity\EntityManager $entity_manager - * The entity manager - * @param \Drupal\Core\Session\AccountInterface $current_user - * The current user. - */ - public function __construct(EntityManager $entity_manager, AccountInterface $current_user) { - $this->userStorageController = $entity_manager->getStorageController('user'); - $this->currentUser = $current_user; - } - - /** - * {@inheritdoc} - */ - public function applies(Request $request) { - return TRUE; - } - - /** - * {@inheritdoc} - */ - public function determineActiveTheme(Request $request) { - if ($user = $this->userStorageController->load($this->currentUser->id())) {; - // Only select the user selected theme if it is available in the - // list of themes that can be accessed. - if (!empty($user->theme) && drupal_theme_access($user->theme)) { - return $user->theme; - } - } - } - -} diff --git a/core/modules/user/lib/Drupal/user/UserInterface.php b/core/modules/user/lib/Drupal/user/UserInterface.php index e2474bc82293bfd3465872beefc88ba60f374540..4022179e8c1f3d2492994d7a667337b171e5e91d 100644 --- a/core/modules/user/lib/Drupal/user/UserInterface.php +++ b/core/modules/user/lib/Drupal/user/UserInterface.php @@ -83,14 +83,6 @@ public function setPassword($password); */ public function setEmail($mail); - /** - * Returns the default theme of the user. - * - * @return string - * Name of the theme. - */ - public function getDefaultTheme(); - /** * Returns the user signature. * diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 67c9fcca43812485e6e992f26b3d8a88a1901a07..a194b00762aa181f7c8ff77bcde1eef3f3e2bc25 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -58,13 +58,6 @@ function user_schema() { 'default' => '', 'description' => "User's e-mail address.", ), - 'theme' => array( - 'type' => 'varchar', - 'length' => DRUPAL_EXTENSION_NAME_MAX_LENGTH, - 'not null' => TRUE, - 'default' => '', - 'description' => "User's default theme.", - ), 'signature' => array( 'type' => 'varchar', 'length' => 255, @@ -998,16 +991,6 @@ function user_update_8019() { db_change_field('users_data', 'module', 'module', $spec); } - if (db_field_exists('users', 'theme')) { - $spec = array( - 'type' => 'varchar', - 'length' => 50, - 'not null' => TRUE, - 'default' => '', - 'description' => "User's default theme.", - ); - db_change_field('users', 'theme', 'theme', $spec); - } } /** diff --git a/core/modules/user/user.services.yml b/core/modules/user/user.services.yml index 05382aff7aa0ffb59b98a19285ea125f1b1e2632..d255dfdba56c1c0d11c6a245280ff1fa17b2bdaf 100644 --- a/core/modules/user/user.services.yml +++ b/core/modules/user/user.services.yml @@ -25,11 +25,6 @@ services: class: Drupal\user\EventSubscriber\MaintenanceModeSubscriber tags: - { name: event_subscriber } - theme.negotiator.user: - class: Drupal\user\Theme\UserNegotiator - arguments: ['@entity.manager', '@current_user'] - tags: - - { name: theme_negotiator, priority: -50 } theme.negotiator.admin_theme: class: Drupal\user\Theme\AdminNegotiator arguments: ['@current_user', '@config.factory', '@entity.manager'] diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php index 897bfd923de07ad43cad144d215b13183a0fa770..87732485d4588b5eb293fdda1902cac2cf1184e4 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldCounterTest.php @@ -19,7 +19,7 @@ class FieldCounterTest extends ViewUnitTestBase { * * @var array */ - public static $modules = array('user', 'field'); + public static $modules = array('user'); /** * Views used by this test. @@ -36,12 +36,6 @@ public static function getInfo() { ); } - protected function setUp() { - parent::setUp(); - - $this->installSchema('user', 'users'); - } - function testSimple() { $view = views_get_view('test_view'); $view->setDisplay(); diff --git a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php index affd9bdc526ee302d51ec154c56f1b591b428e03..6ad3b19a4d79cf68c72e147c1a086ed479063238 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Handler/FieldUnitTest.php @@ -17,7 +17,7 @@ */ class FieldUnitTest extends ViewUnitTestBase { - public static $modules = array('user', 'field'); + public static $modules = array('user'); /** * Views used by this test. @@ -38,12 +38,6 @@ public static function getInfo() { ); } - protected function setUp() { - parent::setUp(); - - $this->installSchema('user', 'users'); - } - /** * Overrides Drupal\views\Tests\ViewTestBase::viewsData(). */ diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php index 32c3bfc8659d32f6268a4bae2e42aa07ac99fdda..b0d830b6ec7a7999b37fe3834e79339e2adc409b 100644 --- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayPageTest.php @@ -59,7 +59,6 @@ protected function setUp() { // Setup the needed tables in order to make the drupal router working. $this->installSchema('system', array('router', 'menu_router', 'url_alias')); $this->installSchema('menu_link', 'menu_links'); - $this->installSchema('user', 'users'); } /**