Skip to content
Snippets Groups Projects
Commit e3023513 authored by Flocon de toile's avatar Flocon de toile Committed by Vladimir Roudakov
Browse files

Issue #3258016 by flocondetoile: Fatal error on Drupal 9 : Call to undefined...

Issue #3258016 by flocondetoile: Fatal error on Drupal 9 : Call to undefined method WebformSubmissionSubmittedToLabel::getEntityTypeManager()
parent 9b254271
No related branches found
No related tags found
No related merge requests found
...@@ -14,11 +14,18 @@ trait WebformSubmissionSubmittedToTrait { ...@@ -14,11 +14,18 @@ trait WebformSubmissionSubmittedToTrait {
use EntityTranslationRenderTrait; use EntityTranslationRenderTrait;
/** /**
* The entity manager. * The entity type manager.
* *
* @var \Drupal\Core\Entity\EntityManagerInterface * @var \Drupal\Core\Entity\EntityTypeManagerInterface
*/ */
protected $entityManager; protected $entityTypeManager;
/**
* The entity repository service.
*
* @var \Drupal\Core\Entity\EntityRepositoryInterface
*/
protected $entityRepository;
/** /**
* The language manager. * The language manager.
...@@ -42,16 +49,38 @@ trait WebformSubmissionSubmittedToTrait { ...@@ -42,16 +49,38 @@ trait WebformSubmissionSubmittedToTrait {
} }
/** /**
* {@inheritdoc} * Get the entity type manager service.
*
* @return \Drupal\Core\Entity\EntityTypeManagerInterface
* The entity type manager.
*/
protected function getEntityTypeManager() {
if (!$this->entityTypeManager) {
$this->entityTypeManager = \Drupal::entityTypeManager();
}
return $this->entityTypeManager;
}
/**
* Get the entity repository service.
*
* @return \Drupal\Core\Entity\EntityRepositoryInterface
* The entity repository.
*/ */
protected function getEntityManager() { protected function getEntityRepository() {
return $this->entityManager; if (!$this->entityRepository) {
$this->entityRepository = \Drupal::service('entity.repository');
}
return $this->entityRepository;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function getLanguageManager() { protected function getLanguageManager() {
if (!$this->languageManager) {
$this->languageManager = \Drupal::languageManager();
}
return $this->languageManager; return $this->languageManager;
} }
......
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