Skip to content
Snippets Groups Projects
Verified Commit c3ebbc48 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #2936642 by tim.plunkett: Getting runtime contexts will generate an...

Issue #2936642 by tim.plunkett: Getting runtime contexts will generate an E_WARNING for anonymous users
parent 40af3f5a
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -50,9 +50,11 @@ public function __construct(AccountInterface $account, EntityManagerInterface $e ...@@ -50,9 +50,11 @@ public function __construct(AccountInterface $account, EntityManagerInterface $e
public function getRuntimeContexts(array $unqualified_context_ids) { public function getRuntimeContexts(array $unqualified_context_ids) {
$current_user = $this->userStorage->load($this->account->id()); $current_user = $this->userStorage->load($this->account->id());
// @todo Do not validate protected fields to avoid bug in TypedData, remove if ($current_user) {
// this in https://www.drupal.org/project/drupal/issues/2934192. // @todo Do not validate protected fields to avoid bug in TypedData,
$current_user->_skipProtectedUserFieldConstraint = TRUE; // remove this in https://www.drupal.org/project/drupal/issues/2934192.
$current_user->_skipProtectedUserFieldConstraint = TRUE;
}
$context = new Context(new ContextDefinition('entity:user', $this->t('Current user')), $current_user); $context = new Context(new ContextDefinition('entity:user', $this->t('Current user')), $current_user);
$cacheability = new CacheableMetadata(); $cacheability = new CacheableMetadata();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment