Skip to content
Snippets Groups Projects

Issue #3507382: returning translated entity for the commented entity.

2 files
+ 16
1
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -363,7 +363,13 @@ public function getParentComment() {
* {@inheritdoc}
*/
public function getCommentedEntity() {
return $this->get('entity_id')->entity;
$language = $this->language()->getId();
/** @var \Drupal\Core\Entity\EntityInterface $entity */
$entity = $this->get('entity_id')->entity;
if ($entity?->hasTranslation($language)) {
return $entity->getTranslation($language);
}
return $entity;
}
/**
Loading