diff --git a/core/lib/Drupal/Core/Entity/EntityAccessController.php b/core/lib/Drupal/Core/Entity/EntityAccessController.php index 77d60fa..e92afbe 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessController.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessController.php @@ -41,10 +41,6 @@ public function access(EntityInterface $entity, $operation, $langcode = LANGUAGE // that have checks that need to be done before the hook is invoked should // do so by overridding this method. - if ($account instanceof User) { - $account = $account->getBCEntity(); - } - // We grant access to the entity if both of these conditions are met: // - No modules say to deny access. // - At least one module says to grant access. diff --git a/core/lib/Drupal/Core/Entity/Field/Type/EntityTranslation.php b/core/lib/Drupal/Core/Entity/Field/Type/EntityTranslation.php index cf48a63..0de1e4d 100644 --- a/core/lib/Drupal/Core/Entity/Field/Type/EntityTranslation.php +++ b/core/lib/Drupal/Core/Entity/Field/Type/EntityTranslation.php @@ -7,14 +7,14 @@ namespace Drupal\Core\Entity\Field\Type; -use ArrayIterator; use Drupal\Core\TypedData\AccessibleInterface; use Drupal\Core\TypedData\ComplexDataInterface; use Drupal\Core\TypedData\TypedData; -use Drupal\Core\TypedData\TypedDataInterface; use Drupal\user\UserInterface; -use InvalidArgumentException; +use ArrayIterator; +use Drupal\Core\TypedData\TypedDataInterface; use IteratorAggregate; +use InvalidArgumentException; /** * Allows accessing and updating translated entity fields. diff --git a/core/lib/Drupal/Core/Entity/Field/Type/Field.php b/core/lib/Drupal/Core/Entity/Field/Type/Field.php index 71c3671..b5a760d 100644 --- a/core/lib/Drupal/Core/Entity/Field/Type/Field.php +++ b/core/lib/Drupal/Core/Entity/Field/Type/Field.php @@ -155,7 +155,7 @@ public function __unset($property_name) { public function access($operation = 'view', UserInterface $account = NULL) { global $user; if (!isset($account) && $user->uid) { - $account = user_load($user->uid)->getNGEntity(); + $account = user_load($user->uid); } // Get the default access restriction that lives within this field. $access = $this->defaultAccess($operation, $account); diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php index 24fcc49..cee642e 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php @@ -88,7 +88,7 @@ function testConfigLocaleUserOverride() { )); $user_config_context = config_context_enter('Drupal\user\UserConfigContext'); - $user_config_context->setAccount($account->getNGEntity()); + $user_config_context->setAccount($account); $config = config('config_test.system'); $this->assertIdentical($config->get('foo'), 'fr bar'); // Ensure the non-overriden value is still the same. @@ -111,7 +111,7 @@ function testConfigLocaleUserOverride() { )); $config_factory = drupal_container()->get('config.factory'); - $config_factory->enterContext($user_config_context->setAccount($account->getNGEntity())); + $config_factory->enterContext($user_config_context->setAccount($account)); // Should not have to re-initialize the configuration object to get new // overrides as the new context will have a different uuid. $config = config('config_test.system'); @@ -127,7 +127,7 @@ function testConfigLocaleUserOverride() { )); // Create a new user config context to stack on top of the existign one. $en_user_config_context = config_context_enter('Drupal\user\UserConfigContext'); - $en_user_config_context->setAccount($account->getNGEntity()); + $en_user_config_context->setAccount($account); $config = config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); @@ -178,7 +178,7 @@ function testConfigLocaleUserAndGlobalOverride() { )); $user_config_context = config_context_enter('Drupal\user\UserConfigContext'); - $user_config_context->setAccount($account->getNGEntity()); + $user_config_context->setAccount($account); $config = config('config_test.system'); $this->assertIdentical($config->get('foo'), 'fr bar'); // Ensure the value overriden from global $conf works. diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php index 5df3502..e4c675d 100644 --- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php +++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php @@ -167,7 +167,7 @@ public function save(array $form, array &$form_state) { $to = implode(', ', $category->recipients); $recipient_langcode = language_default()->langcode; } - elseif ($message->recipient && $message->recipient instanceof UserInterface) { + elseif ($message->recipient instanceof UserInterface) { // Send to the user in the user's preferred language. $to = $message->recipient->mail; $recipient_langcode = user_preferred_langcode($message->recipient); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php index 9703f73..c1c7ea8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityAccessTest.php @@ -82,7 +82,7 @@ function testEntityAccess() { 'update' => FALSE, 'delete' => FALSE, 'view' => FALSE, - ), $entity, $custom_user->getNGEntity()); + ), $entity, $custom_user); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php b/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php index a0e2382..882ae96 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Plugin/ContextPluginTest.php @@ -99,7 +99,7 @@ function testContext() { // Set an appropriate context value appropriately and check to make sure // its methods work as expected. - $user = entity_create('user', array('name' => $name))->getNGEntity(); + $user = entity_create('user', array('name' => $name)); $plugin->setContextValue('user', $user); $this->assertEqual($user->label(), $plugin->getTitle()); diff --git a/core/modules/user/user.module b/core/modules/user/user.module index eb2e1ce..2ef36cf 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1773,7 +1773,7 @@ function user_mail($key, &$message, $params) { // allows the configuration objects to be localized for the user's language if // the locale module is enabled. $user_config_context = config_context_enter('Drupal\user\UserConfigContext'); - $user_config_context->setAccount($params['account']->getNGEntity()); + $user_config_context->setAccount($params['account']); $mail_config = config('user.mail'); // We do not sanitize the token replacement, since the output of this