diff --git a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php index 2079d48..70cb791 100644 --- a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php @@ -9,7 +9,7 @@ use Drupal\Core\Cache\CacheBackendInterface; use Drupal\Core\Database\Connection; -use Drupal\Core\Entity\Field\PrepareCacheInterface; +use Drupal\Core\Entity\PrepareCacheInterface; use Drupal\Core\Entity\Query\QueryInterface; use Drupal\Core\Language\Language; use Drupal\Component\Utility\NestedArray; @@ -221,6 +221,14 @@ public function loadMultiple(array $ids = NULL) { // were passed. The $ids array is reduced as items are loaded from cache, // and we need to know if it's empty for this reason to avoid querying the // database when all requested entities are loaded from cache. + if (is_array($ids)) { + foreach ($ids as $id) { + if (!is_scalar($id)) { + debug($id); + debug(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); + } + } + } $passed_ids = !empty($ids) ? array_flip($ids) : FALSE; // Try to load entities from the static cache, if the entity type supports // static caching. diff --git a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php b/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php index 5d99db0..a20942a 100644 --- a/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php +++ b/core/lib/Drupal/Core/Entity/FieldableEntityStorageControllerBase.php @@ -7,11 +7,8 @@ namespace Drupal\Core\Entity; -use Drupal\Core\Field\PrepareCacheInterface; use Drupal\field\FieldInterface; use Drupal\field\FieldInstanceInterface; -use Drupal\Core\Field\ConfigFieldItemListInterface; -use Symfony\Component\DependencyInjection\Container; abstract class FieldableEntityStorageControllerBase extends EntityStorageControllerBase implements FieldableEntityStorageControllerInterface { diff --git a/core/modules/comment/lib/Drupal/comment/CommentRenderController.php b/core/modules/comment/lib/Drupal/comment/CommentRenderController.php index b577b27..4973d1f 100644 --- a/core/modules/comment/lib/Drupal/comment/CommentRenderController.php +++ b/core/modules/comment/lib/Drupal/comment/CommentRenderController.php @@ -93,6 +93,7 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang foreach ($entities as $entity) { $uids[] = $entity->uid->target_id; } + debug($uids); $this->entityManager->getStorageController('user')->loadMultiple(array_unique($uids)); parent::buildContent($entities, $displays, $view_mode, $langcode); diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php index d3adea5..db45245 100644 --- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php @@ -35,6 +35,7 @@ * base_table = "comment", * uri_callback = "comment_uri", * fieldable = TRUE, + * field_cache = FALSE, * translatable = TRUE, * render_cache = FALSE, * route_base_path = "admin/structure/comments/manage/{bundle}", diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 41dbae9..ec5c49e 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -1042,6 +1042,7 @@ function user_login_finalize(UserInterface $account) { ->fields(array('login' => $user->getLastLoginTime())) ->condition('uid', $user->id()) ->execute(); + \Drupal::entityManager()->getStorageController('user')->resetCache(array($account->id())); // Regenerate the session ID to prevent against session fixation attacks. // This is called before hook_user in case one of those functions fails