diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php index 965de84..caef125 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php @@ -121,9 +121,6 @@ class DatabaseStorageController implements EntityStorageControllerInterface { */ public function __construct($entityType) { $this->entityType = $entityType; - if (!function_exists('entity_get_info')) { - debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); - } $this->entityInfo = entity_get_info($entityType); $this->entityCache = array(); $this->hookLoadArguments = array(); @@ -168,6 +165,8 @@ public function resetCache(array $ids = NULL) { } else { $this->entityCache = array(); + $this->entityFieldInfo = NULL; + $this->fieldDefinitions = array(); } } diff --git a/core/lib/Drupal/Core/Entity/Field/Type/Field.php b/core/lib/Drupal/Core/Entity/Field/Type/Field.php index 305fc1f..6e2450f 100644 --- a/core/lib/Drupal/Core/Entity/Field/Type/Field.php +++ b/core/lib/Drupal/Core/Entity/Field/Type/Field.php @@ -151,7 +151,7 @@ public function __unset($property_name) { public function access($operation = 'view', User $account = NULL) { global $user; if (!isset($account) && $user->uid) { - $account = user_load($user->uid); + $account = user_load($user->uid)->getOriginalEntity(); } // Get the default access restriction that lives within this field. $access = $this->defaultAccess($operation, $account); diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php index ee2b0c3..225c708 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php @@ -62,6 +62,12 @@ function testUninstallProcess() { $language_manager->init(); // Check the UI language. + // @todo: If the global user is an EntityBCDecorator, getting the roles + // roles from it within LocaleLookup results in a loop that invokes + // LocaleLookup again. + global $user; + $user = drupal_anonymous_user(); + $this->assertEqual(language(LANGUAGE_TYPE_INTERFACE)->langcode, $this->langcode, t('Current language: %lang', array('%lang' => language(LANGUAGE_TYPE_INTERFACE)->langcode))); // Enable multilingual workflow option for articles. diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php index 32fc112..44b08e2 100644 --- a/core/modules/user/lib/Drupal/user/AccountFormController.php +++ b/core/modules/user/lib/Drupal/user/AccountFormController.php @@ -234,7 +234,6 @@ public function buildEntity(array $form, array &$form_state) { $form_state['values']['roles'] = array_keys(array_filter($form_state['values']['roles'])); $this->roles_filtered = TRUE; } - debug($form_state['values']); return parent::buildEntity($form, $form_state); } diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php index 15894ad..a4bfd52 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php @@ -33,7 +33,7 @@ function setUp() { parent::setUp(); $this->account = $this->drupalCreateUser(); - $this->anonymous = drupal_anonymous_user(); + $this->anonymous = entity_create('user', (array) drupal_anonymous_user()); } /** diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php index a1c23e5..816aaa5 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php @@ -183,7 +183,6 @@ function testRegistrationDefaultValues() { $this->assertEqual($new_user->signature->value, '', 'Correct signature field.'); $this->assertTrue(($new_user->created->value > REQUEST_TIME - 20 ), 'Correct creation time.'); $this->assertEqual($new_user->status->value, $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.'); - debug($new_user->timezone->value); $this->assertEqual($new_user->timezone->value, $config_system_timezone->get('default'), 'Correct time zone field.'); $this->assertEqual($new_user->langcode->value, language_default()->langcode, 'Correct language field.'); $this->assertEqual($new_user->preferred_langcode->value, language_default()->langcode, 'Correct preferred language field.'); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php b/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php index 171a976..fe3fa0f 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserTranslationUITest.php @@ -39,6 +39,8 @@ function setUp() { $this->testLanguageSelector = FALSE; $this->name = $this->randomName(); parent::setUp(); + + entity_get_controller('user')->resetCache(); } /**